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. קרא עוד ב־תנאי השימוש.