Dynamic Volatility EnvelopeDynamic Volatility Envelope: Indicator Overview
The Dynamic Volatility Envelope is an advanced, multi-faceted technical indicator designed to provide a comprehensive view of market trends, volatility, and potential future price movements. It centers around a customizable linear regression line, enveloped by dynamically adjusting volatility bands. The indicator offers rich visual feedback through gradient coloring, candle heatmaps, a background volatility pulse, and an on-chart trend strength meter.
Core Calculation Mechanism
Linear Regression Core :
-A central linear regression line is calculated based on a user-defined source (e.g., close, hl2) and lookback period.
-The regression line can be optionally smoothed using an Exponential Moving Average (EMA) to reduce noise.
-The slope of this regression line is continuously calculated to determine the current trend direction and strength.
Volatility Channel :
-Dynamic bands are plotted above and below a central basis line. This basis is typically the calculated regression line but shifts to an EMA in Keltner mode.
-The width of these bands is determined by market volatility, using one of three user-selectable modes:
ATR Mode : Bandwidth is a multiple of the Average True Range (ATR).
Standard Deviation Mode : Bandwidth is a multiple of the Standard Deviation of the source data.
Keltner Mode (EMA-based ATR) : ATR-based bands are plotted around a central Keltner EMA line, offering a smoother channel.
The channel helps identify dynamic support and resistance levels and assess market volatility.
Future Projection :
The indicator can project the current regression line and its associated volatility bands into the future for a user-defined number of bars. This provides a visual guide for potential future price pathways based on current trend and volatility characteristics.
Candle Heatmap Coloring :
-Candle bodies and/or wicks/borders can be colored based on the price's position within the upper and lower volatility bands.
-Colors transition in a gradient from bearish (when price is near the lower band) through neutral (mid-channel) to bullish (when price is near the upper band), providing an intuitive visual cue of price action relative to the dynamic envelope.
Background Volatility Pulse :
The chart background color can be set to dynamically shift based on a ratio of short-term to long-term ATR. This creates a "pulse" effect, where the background subtly changes color to indicate rising or falling market volatility.
Trend Strength Meter :
An on-chart text label displays the current trend status (e.g., "Strong Bullish", "Neutral", "Bearish") based on the calculated slope of the regression line relative to user-defined thresholds for normal and strong trends.
Key Features & Components
-Dynamic Linear Regression Line: Core trend indicator with optional smoothing and slope-based gradient coloring.
-Multi-Mode Volatility Channel: Choose between ATR, Standard Deviation, or Keltner (EMA-based ATR) calculations for band width.
-Customizable Vertical Gradient Channel Fills: Visually distinct fills for upper and lower channel segments with user-defined top/bottom colors and gradient spread.
-Future Projection: Extrapolates regression line and volatility bands to forecast potential price paths.
-Price-Action Based Candle Heatmap: Intuitive candle coloring based on position within the volatility channel, with adjustable gradient midpoint.
-Volatility-Reactive Background Gradient: Subtle background color shifts to reflect changes in market volatility.
-On-Chart Trend Strength Meter: Clear textual display of current trend direction and strength.
-Extensive Visual Customization: Fine-tune colors, line styles, widths, and gradient aggressiveness for most visual elements.
-Comprehensive Tooltips: Detailed explanations for every input setting, ensuring ease of use and understanding.
Visual Elements Explained
Regression Line : The primary trend line. Its color dynamically changes (e.g., green for uptrend, red-pink for downtrend, neutral for flat) based on its slope, with smooth gradient transitions.
Volatility Channel :
Upper & Lower Bands : These lines form the outer boundaries of the envelope, acting as dynamic support and resistance levels.
Channel Fill : The area between the band center and the outer bands is filled with a vertical gradient. For example, the upper band fill might transition from a darker green near the center to a lighter green at the upper band.
Band Borders : The lines outlining the upper and lower bands, with customizable color and width.
Future Projection Lines & Fill :
Projected Regression Line : An extension of the current regression line into the future, typically styled differently (e.g., dashed).
Projected Channel Bands : Extensions of the upper and lower volatility bands.
Projected Area Fill : A semi-transparent fill between the projected upper and lower bands.
Candle Heatmap Coloring : When enabled, candles are colored based on their closing price's relative position within the channel. Bullish colors appear when price is in the upper part of the channel, bearish in the lower, and neutral in the middle. Users can choose to color the entire candle body or just the wicks and borders.
Background Volatility Pulse : The chart's background color subtly shifts (e.g., between a calm green and an agitated red-pink) to reflect the current volatility regime.
Trend Strength Meter : A text label (e.g., "TREND: STRONG BULLISH") positioned on the chart, providing an at-a-glance summary of the trend.
Configuration Options
Users can tailor the indicator extensively via the settings panel, with options logically grouped:
Core Analysis Engine : Adjust regression source data, lookback period, and EMA smoothing for the regression line.
Regression Line Visuals : Control visibility, line width, trend-based colors (uptrend, downtrend, flat), slope thresholds for trend definition, strong slope multiplier (for Trend Meter), and color gradient sharpness.
Volatility Channel Configuration : Select band calculation mode (ATR, StdDev, Keltner), set relevant periods and multipliers. Customize colors for vertical gradient fills (upper/lower, top/bottom), border line colors, widths, and the gradient spread factor for fills.
Future Projection Configuration : Toggle visibility, set projection length (number of bars), line style, and colors for projected regression and band areas.
Appearance & Candle Theme : Set default bull/bear candle colors, enable/disable candle heatmap, choose if body color matches heatmap, and configure heatmap gradient target colors (bull, neutral, bear) and the gradient's midpoint.
Background Volatility Pulse : Enable/disable the background effect and configure short/long ATR periods for the volatility calculation.
Trend Strength Meter : Enable/disable the meter, and choose its on-chart position and text size.
Interpretation Notes
-The Regression Line is the primary indicator of trend direction. Its slope and color provide immediate insight.
-The Volatility Bands serve as dynamic support and resistance zones. Price approaching or touching these bands may indicate potential turning points or breakouts. The width of the channel itself reflects market volatility – widening suggests increasing volatility, while narrowing suggests consolidation.
Future Projections are not predictions but rather an extension of current conditions. They can help visualize potential areas where price might interact with projected support/resistance if the current trend and volatility persist.
Candle Heatmap Coloring offers a quick visual assessment of where price is trading within the dynamic envelope, highlighting strength or weakness relative to the channel.
The Background Volatility Pulse gives a contextual feel for overall market agitation or calmness.
This indicator is designed to be a comprehensive analytical tool. Its signals and visualizations are best used in conjunction with other technical analysis techniques, price action study, and robust risk management practices. It is not intended as a standalone trading system.
Risk Disclaimer
Trading and investing in financial markets involve substantial risk of loss and is not suitable for every investor. The Dynamic Volatility Envelope indicator is provided for analytical and educational purposes only and does not constitute financial advice or a recommendation to buy or sell any security. Past performance is not indicative of future results. Always use sound risk management practices and never trade with capital you cannot afford to lose. The developers assume no liability for any financial losses incurred based on the use of this indicator.
Dynamicchannels
Nico's SPX Dynamic ChannelsTest of dynamic channels and some statistics made by hand.
This indicator was done specifically for the S&P500 index.
As you can see, below the 125 EMA there's a lot more volatility than in the upside. I've made some kind of a dynamic linear regression of the lows and the highs.
I've chosen the MA that best fits the SPX, and then calculated in Excel the percental mean and SDs of most important peaks and valleys that I've chosen in comparison to the 125 MA. This lead to the green, orange and red zones. BUT, I've calculated the peaks and valleys separately, as I assumed that a bear market and crashes have way more volatility than bull markets. That's why the difference between the upper and the lower channels.
The neutral blue zone is composed by an upper EMA of the highs and lower EMA of the lows. No MA in this script uses the close price as a source.
This MA makes sense because it represents a semester of trading, for this particular asset.
Backtest results
It's also interesting to try it here too, as it has a little bit more of data:
SPCFD:SPX
As it's not a trading system, I have no batting average nor ratios for this.
Still, the measures of the peaks and valleys are very accurate and repeat themselves over and over again. The results were:
3rd resistance: 12.88%
2nd resistance: 10.12%
1st resistance: 7.36%
1st support: -6.42%
2nd support: -14.8%
3rd support: -23.18%
All referred to the mean, which is the 125 EMA zone.
After the 1950's works like magic, but not before. You will see that it doesn't work in the great depression and it's crash.
How to use this indicator
Green = First grade support/resistance .
Orange = Second grade support/resistance . Caution.
Red = Third grade support/resistance . High chances of mean reversal.
Blue zone = This is the neutral zone, where the prices are not cheap nor expensive.
Often in a trending market, the price will have the blue zone as it's main support and when trending the price will stick to the green MA.
When the price touches the orange MA, the most probable is that it will return to the green MA.
If the price touches the red zone, there's a high chance that this is a big turning point and it will reverse to the mean (green or blue zone).
Imagine you've bought each time the price touched the red support, check that and you'll start liking this indicator. I think it is a great entry point for investors. The red resistance is good too, but of course it works for a short period of time.
I've backtested this indicator since the beginning of the dataset and it works like magic, but ONLY for the SPX index (spot price).
Leave a comment or some coins if you like it!!!
(I've posted it before like an analysis, not as a script, my bad)