OPEN-SOURCE SCRIPT
TMT Market Structure

1. Automatic Trendlines
Added both Short-Term Trendlines and Long-Term Trendlines.
These are controlled in the new Trendlines settings group, where you can adjust the "Pivot Length" for both. The shorter the length (default 5), the closer it tracks recent price action. A longer length (default 15) filters for larger macroeconomic swings.
The trendlines extend dynamically to the right and automatically clean up historical lines to keep the chart clutter-free.
2. Sideways Market Zones (Boxes)
The indicator now detects periods of consolidation when price struggles to create new structure breaks (failing to make a higher high or lower low beyond the ATR filter constraint).
When this triggers, it draws a yellow Range Box stretching from the highest point to the lowest point of the local structure and extends it forward in time until price breaks out.
3. Breakout Signals
Once the price definitively closes outside of the Sideways Range Box (incorporating your ATR noise filter so it ignores fake wick-outs), the indicator closes the box.
It prints "BRK UP" (Breakout Up) or "BRK DN" (Breakout Down) on the chart.
Corresponding breakout alerts (Range breakout UP & Range breakout DOWN) have been added to the script so you can get notified precisely when a consolidation period ends.
Added both Short-Term Trendlines and Long-Term Trendlines.
These are controlled in the new Trendlines settings group, where you can adjust the "Pivot Length" for both. The shorter the length (default 5), the closer it tracks recent price action. A longer length (default 15) filters for larger macroeconomic swings.
The trendlines extend dynamically to the right and automatically clean up historical lines to keep the chart clutter-free.
2. Sideways Market Zones (Boxes)
The indicator now detects periods of consolidation when price struggles to create new structure breaks (failing to make a higher high or lower low beyond the ATR filter constraint).
When this triggers, it draws a yellow Range Box stretching from the highest point to the lowest point of the local structure and extends it forward in time until price breaks out.
3. Breakout Signals
Once the price definitively closes outside of the Sideways Range Box (incorporating your ATR noise filter so it ignores fake wick-outs), the indicator closes the box.
It prints "BRK UP" (Breakout Up) or "BRK DN" (Breakout Down) on the chart.
Corresponding breakout alerts (Range breakout UP & Range breakout DOWN) have been added to the script so you can get notified precisely when a consolidation period ends.
开源脚本
秉承TradingView的精神,该脚本的作者将其开源,以便交易者可以查看和验证其功能。向作者致敬!您可以免费使用该脚本,但请记住,重新发布代码须遵守我们的网站规则。
Tradingmientrung
免责声明
这些信息和出版物并非旨在提供,也不构成TradingView提供或认可的任何形式的财务、投资、交易或其他类型的建议或推荐。请阅读使用条款了解更多信息。
开源脚本
秉承TradingView的精神,该脚本的作者将其开源,以便交易者可以查看和验证其功能。向作者致敬!您可以免费使用该脚本,但请记住,重新发布代码须遵守我们的网站规则。
Tradingmientrung
免责声明
这些信息和出版物并非旨在提供,也不构成TradingView提供或认可的任何形式的财务、投资、交易或其他类型的建议或推荐。请阅读使用条款了解更多信息。