OPEN-SOURCE SCRIPT
Dynamic Slope-Compressed TMA

This indicator is a modified Triangular Moving Average-style band system designed to adapt its upper and lower bands based on directional moving-average slope.
The midline is built from a TMA-style smoothing structure using selectable WMA, DWMA, or TWMA logic, with ATR-based upper and lower bands around the midline. The key feature is dynamic band compression: when the selected slope MA is strongly rising, the upper band remains fully expanded while the lower band gradually compresses toward the midline. When the selected slope MA is strongly falling, the lower band remains fully expanded while the upper band gradually compresses toward the midline.
This creates an adaptive channel that reflects directional pressure. In strong uptrends, downside band space contracts toward the midline. In strong downtrends, upside band space contracts toward the midline. At maximum slope strength, the compressed side can reach the midline, depending on the user’s settings.
Main features:
TMA-style midline using selectable WMA, DWMA, or TWMA smoothing
ATR-based upper and lower bands
Dynamic slope-based compression of the opposite-side band
User-selectable slope MA type, length, lookback, and source
Adjustable slope sensitivity using ATR-normalized slope strength
Optional minimum compressed band width
Optional original uncompressed bands for comparison
Optional debug values for compression and slope behavior
How it works:
The indicator calculates a TMA-style midline and standard ATR bands. It then measures the slope of a user-selected moving average. When slope strength increases upward, the lower band moves closer to the midline while the upper band stays at the normal ATR distance. When slope strength increases downward, the upper band moves closer to the midline while the lower band stays at the normal ATR distance.
This can help visualize when price is trending strongly enough that one side of the channel should tighten rather than remain symmetrical.
Suggested use:
This indicator can be used as a trend-aware volatility channel, a directional mean-reversion reference, or a visual filter for overextended price action. It is not intended to be used as a standalone buy/sell signal. Traders should combine it with their own confirmation tools, market structure, volume/VWAP, or higher-timeframe analysis.
Important note:
This indicator does not guarantee future price movement. It is a visual and analytical tool only. Use proper risk management and test all settings before using it in live trading.
The midline is built from a TMA-style smoothing structure using selectable WMA, DWMA, or TWMA logic, with ATR-based upper and lower bands around the midline. The key feature is dynamic band compression: when the selected slope MA is strongly rising, the upper band remains fully expanded while the lower band gradually compresses toward the midline. When the selected slope MA is strongly falling, the lower band remains fully expanded while the upper band gradually compresses toward the midline.
This creates an adaptive channel that reflects directional pressure. In strong uptrends, downside band space contracts toward the midline. In strong downtrends, upside band space contracts toward the midline. At maximum slope strength, the compressed side can reach the midline, depending on the user’s settings.
Main features:
TMA-style midline using selectable WMA, DWMA, or TWMA smoothing
ATR-based upper and lower bands
Dynamic slope-based compression of the opposite-side band
User-selectable slope MA type, length, lookback, and source
Adjustable slope sensitivity using ATR-normalized slope strength
Optional minimum compressed band width
Optional original uncompressed bands for comparison
Optional debug values for compression and slope behavior
How it works:
The indicator calculates a TMA-style midline and standard ATR bands. It then measures the slope of a user-selected moving average. When slope strength increases upward, the lower band moves closer to the midline while the upper band stays at the normal ATR distance. When slope strength increases downward, the upper band moves closer to the midline while the lower band stays at the normal ATR distance.
This can help visualize when price is trending strongly enough that one side of the channel should tighten rather than remain symmetrical.
Suggested use:
This indicator can be used as a trend-aware volatility channel, a directional mean-reversion reference, or a visual filter for overextended price action. It is not intended to be used as a standalone buy/sell signal. Traders should combine it with their own confirmation tools, market structure, volume/VWAP, or higher-timeframe analysis.
Important note:
This indicator does not guarantee future price movement. It is a visual and analytical tool only. Use proper risk management and test all settings before using it in live trading.
Script open-source
Nello spirito di TradingView, l'autore di questo script lo ha reso open source, in modo che i trader possano esaminarne e verificarne la funzionalità. Complimenti all'autore! Sebbene sia possibile utilizzarlo gratuitamente, ricordiamo che la ripubblicazione del codice è soggetta al nostro Regolamento.
Declinazione di responsabilità
Le informazioni e le pubblicazioni non sono intese come, e non costituiscono, consulenza o raccomandazioni finanziarie, di investimento, di trading o di altro tipo fornite o approvate da TradingView. Per ulteriori informazioni, consultare i Termini di utilizzo.
Script open-source
Nello spirito di TradingView, l'autore di questo script lo ha reso open source, in modo che i trader possano esaminarne e verificarne la funzionalità. Complimenti all'autore! Sebbene sia possibile utilizzarlo gratuitamente, ricordiamo che la ripubblicazione del codice è soggetta al nostro Regolamento.
Declinazione di responsabilità
Le informazioni e le pubblicazioni non sono intese come, e non costituiscono, consulenza o raccomandazioni finanziarie, di investimento, di trading o di altro tipo fornite o approvate da TradingView. Per ulteriori informazioni, consultare i Termini di utilizzo.