OPEN-SOURCE SCRIPT
Volatility Cone Forecaster Lite [PhenLabs]

📊Volatility Cone Forecaster [PhenLabs]
Version: PineScript™v6
📌Description
The Volatility Cone Forecaster (VCF) is an advanced indicator designed to provide traders with a forward-looking perspective on market volatility. Instead of merely measuring past price fluctuations, the VCF analyzes historical volatility data to project a statistical “cone” that outlines a probable range for future price movements. Its core purpose is to contextualize the current market environment, helping traders to anticipate potential shifts from low to high volatility periods (and vice versa). By identifying whether volatility is expanding or contracting relative to historical norms, it solves the critical problem of preparing for significant market moves before they happen, offering a clear statistical edge in strategy development.
This indicator moves beyond lagging measures by employing percentile analysis to rank the current volatility state. This allows traders to understand not just what volatility is, but how significant it is compared to the recent past. The VCF is built for discretionary traders, system developers, and options strategists who need a sophisticated understanding of market dynamics to manage risk and identify high-probability opportunities.
🚀Points of Innovation
🔧Core Components
🔥Key Features
🎨Visualization

📖Usage Guidelines
Setting Categories
✅Best Use Cases
⚠️Limitations
💡What Makes This Unique
🔬How It Works
1. Data Calculation:
The indicator first calculates the logarithmic returns of the asset’s price. It then computes the annualized standard deviation of these returns over short, medium, and long-term lookback periods to generate realized volatility readings.
2. Percentile Ranking:
Using a 252-day lookback, it analyzes the history of the medium-term volatility and determines the values that correspond to the 10th, 25th, 50th, 75th, and 90th percentiles. This builds a statistical map of the asset’s volatility behavior.
3. Cone Projection:
Finally, it takes these historical percentile values and projects them forward in time, calculating the potential upper and lower price bounds based on what would happen if volatility were to run at those levels over the next 21 days.
Version: PineScript™v6
📌Description
The Volatility Cone Forecaster (VCF) is an advanced indicator designed to provide traders with a forward-looking perspective on market volatility. Instead of merely measuring past price fluctuations, the VCF analyzes historical volatility data to project a statistical “cone” that outlines a probable range for future price movements. Its core purpose is to contextualize the current market environment, helping traders to anticipate potential shifts from low to high volatility periods (and vice versa). By identifying whether volatility is expanding or contracting relative to historical norms, it solves the critical problem of preparing for significant market moves before they happen, offering a clear statistical edge in strategy development.
This indicator moves beyond lagging measures by employing percentile analysis to rank the current volatility state. This allows traders to understand not just what volatility is, but how significant it is compared to the recent past. The VCF is built for discretionary traders, system developers, and options strategists who need a sophisticated understanding of market dynamics to manage risk and identify high-probability opportunities.
🚀Points of Innovation
- Forward-Looking Volatility Projection: Unlike standard indicators that only show historical data, the VCF projects a statistical cone of future volatility.
- Percentile-Based Regime Analysis: Ranks current volatility against historical data (e.g., 90th, 75th percentiles) to provide objective context.
- Automated Regime Detection: Automatically identifies and labels the market as being in a ‘High’, ‘Low’, or ‘Normal’ volatility regime.
- Expansion & Contraction Signals: Clearly indicates whether volatility is currently increasing or decreasing, signaling shifts in market energy.
- Integrated ATR Comparison: Plots an ATR-equivalent volatility measure to offer a familiar point of reference against the statistical model.
- Dynamic Visual Modeling: The cone visualization directly on the price chart provides an intuitive guide for future expected price ranges.
🔧Core Components
- Realized Volatility Engine: Calculates historical volatility using log returns over multiple user-defined lookback periods (short, medium, long) for a comprehensive view.
- Percentile Analysis Module: A custom function calculates the 10th, 25th, 50th, 75th, and 90th percentiles of volatility over a long-term lookback (e.g., 252 days).
- Forward Projection Calculator: Uses the calculated volatility percentiles to mathematically derive and draw the upper and lower bounds of the future volatility cone.
- Volatility Regime Classifier: A logic-based system that compares current volatility to the historical percentile bands to classify the market state.
🔥Key Features
- Customizable Lookback Periods: Adjust short, medium, and long-term lookbacks to fine-tune the indicator’s sensitivity to different market cycles.
- Configurable Forward Projection: Set the number of days for the forward cone projection to align with your specific trading horizon.
- Interactive Display Options: Toggle visibility for percentile labels, ATR levels, and regime coloring to customize the chart display.
- Data-Rich Information Table: A clean, on-screen table displays all key metrics, including current volatility, percentile rank, regime, and trend.
- Built-in Alert Conditions: Set alerts for critical events like volatility crossing the 90th percentile, dropping below the 10th, or switching between expansion and contraction.
🎨Visualization
- Volatility Cone: Shaded bands projected onto the future price axis, representing the probable price range at different statistical confidence levels (e.g., 75th-90th percentile).
- Color-Coded Volatility Line: The primary volatility plot dynamically changes color (e.g., red for high, green for low) to reflect the current volatility regime, providing instant context.
- Historical Percentile Bands: Horizontal lines plotted across the indicator pane mark the key percentile levels, showing how current volatility compares to the past.
- On-Chart Labels: Clear labels automatically display the current volatility reading, its percentile rank, the detected regime, and trend (Expanding/Contracting).
📖Usage Guidelines
Setting Categories
- Short-term Lookback: Default: 10, Range: 5-50. Controls the most sensitive volatility calculation.
- Medium-term Lookback: Default: 21, Range: 10-100. The primary input for the current volatility reading.
- Long-term Lookback: Default: 63, Range: 30-252. Provides a baseline for long-term market character.
- Percentile Lookback Period: Default: 252, Range: 100-1000. Defines the period for historical ranking; 252 represents one trading year.
- Forward Projection Days: Default: 21, Range: 5-63. Determines how many bars into the future the cone is projected.
✅Best Use Cases
- Breakout Trading: Identify periods of deep consolidation when volatility falls to low percentile ranks (e.g., below 25th) and begins to expand, signaling a potential breakout.
- Mean Reversion Strategies: Target trades when volatility reaches extreme high percentile ranks (e.g., above 90th), as these periods are often unsustainable and lead to contraction.
- Options Strategy: Use the cone’s projected upper and lower bounds to help select strike prices for strategies like iron condors or straddles.
- Risk Management: Widen stop-losses and reduce position sizes when the indicator signals a transition into a ‘High’ volatility regime.
⚠️Limitations
- Probabilistic, Not Predictive: The cone represents a statistical probability, not a guarantee of future price action. Extreme, unpredictable news events can drive prices outside the cone.
- Lagging by Nature: All calculations are based on historical price data, meaning the indicator will always react to, not pre-empt, market changes.
- Non-Directional: The indicator forecasts the *magnitude* of future moves, not the *direction*. It should be paired with a directional analysis tool.
💡What Makes This Unique
- Forward Projection: Its primary distinction is projecting a data-driven, statistical forecast of future volatility, which standard oscillators do not do.
- Contextual Analysis: It doesn’t just provide a number; it tells you what that number means through percentile ranking and automated regime classification.
🔬How It Works
1. Data Calculation:
The indicator first calculates the logarithmic returns of the asset’s price. It then computes the annualized standard deviation of these returns over short, medium, and long-term lookback periods to generate realized volatility readings.
2. Percentile Ranking:
Using a 252-day lookback, it analyzes the history of the medium-term volatility and determines the values that correspond to the 10th, 25th, 50th, 75th, and 90th percentiles. This builds a statistical map of the asset’s volatility behavior.
3. Cone Projection:
Finally, it takes these historical percentile values and projects them forward in time, calculating the potential upper and lower price bounds based on what would happen if volatility were to run at those levels over the next 21 days.
💡Note:
The Volatility Cone Forecaster is most effective on daily and weekly charts where statistical volatility models are more reliable. For lower timeframes, consider shortening the lookback periods. Always use this indicator as part of a comprehensive trading plan that includes other forms of analysis.
Script de código abierto
Siguiendo fielmente el espíritu de TradingView, el creador de este script lo ha publicado en código abierto, permitiendo que otros traders puedan revisar y verificar su funcionalidad. ¡Enhorabuena al autor! Puede utilizarlo de forma gratuita, pero tenga en cuenta que la publicación de este código está sujeta a nuestras Normas internas.
Smart Tools for Smarter Trades: phenlabs.com
Join our growing community: discord.gg/phenlabs
All content provided by PhenLabs is for informational & educational purposes only. Past performance does not guarantee future results.
Join our growing community: discord.gg/phenlabs
All content provided by PhenLabs is for informational & educational purposes only. Past performance does not guarantee future results.
Exención de responsabilidad
La información y las publicaciones que ofrecemos, no implican ni constituyen un asesoramiento financiero, ni de inversión, trading o cualquier otro tipo de consejo o recomendación emitida o respaldada por TradingView. Puede obtener información adicional en las Condiciones de uso.
Script de código abierto
Siguiendo fielmente el espíritu de TradingView, el creador de este script lo ha publicado en código abierto, permitiendo que otros traders puedan revisar y verificar su funcionalidad. ¡Enhorabuena al autor! Puede utilizarlo de forma gratuita, pero tenga en cuenta que la publicación de este código está sujeta a nuestras Normas internas.
Smart Tools for Smarter Trades: phenlabs.com
Join our growing community: discord.gg/phenlabs
All content provided by PhenLabs is for informational & educational purposes only. Past performance does not guarantee future results.
Join our growing community: discord.gg/phenlabs
All content provided by PhenLabs is for informational & educational purposes only. Past performance does not guarantee future results.
Exención de responsabilidad
La información y las publicaciones que ofrecemos, no implican ni constituyen un asesoramiento financiero, ni de inversión, trading o cualquier otro tipo de consejo o recomendación emitida o respaldada por TradingView. Puede obtener información adicional en las Condiciones de uso.