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.
开源脚本
秉承TradingView的精神,该脚本的作者将其开源,以便交易者可以查看和验证其功能。向作者致敬!您可以免费使用该脚本,但请记住,重新发布代码须遵守我们的网站规则。
免责声明
这些信息和出版物并非旨在提供,也不构成TradingView提供或认可的任何形式的财务、投资、交易或其他类型的建议或推荐。请阅读使用条款了解更多信息。
开源脚本
秉承TradingView的精神,该脚本的作者将其开源,以便交易者可以查看和验证其功能。向作者致敬!您可以免费使用该脚本,但请记住,重新发布代码须遵守我们的网站规则。
免责声明
这些信息和出版物并非旨在提供,也不构成TradingView提供或认可的任何形式的财务、投资、交易或其他类型的建议或推荐。请阅读使用条款了解更多信息。