OPEN-SOURCE SCRIPT
Block-Based Trend Breakout (UTB/DTB) & S/R Zones

This indicator is designed to detect potential trend reversals or volatility bursts by analyzing price action structured into "blocks." Its primary goal is to capture the earliest signals that a defined trend structure is weakening or breaking.
Signal Generation:
🛠️ Key Settings
If you find this useful please reach out and let me know how you use it as it's fairly unique... and thus different than anything I've ever seen or used.
Signal Generation:
- 🟢 DTB (Downtrend Breakout): When a confirmed downtrend is identified (e.g., price has been falling for 2 blocks), the indicator waits for the price to break above the highest high of the last completed block in that trend. When this break occurs, it signals a potential bullish reversal with a green DTB triangle below the bar.
- 🔴 UTB (Uptrend Breakdown): When a confirmed uptrend is identified (e.g., price has been rising for 2 blocks), the indicator waits for the price to break below the lowest low of the last completed block. When this break occurs, it signals a potential bearish reversal with a red UTB triangle above the bar.
🛠️ Key Settings
- Block Size (bars): The number of bars in each block used to analyze the trend structure. Lower values track short-term trends; higher values track long-term trends.
- Trend Confirmation (steps): The minimum number of consecutive blocks required to "confirm" a trend.
- Tolerance: Allowed Off-Trend Steps: The number of "noise" blocks allowed while confirming a trend.
- Show Support/Resistance Zones: Toggles the histogram-based S/R zones on or off.
- S/R Lookback (blocks): Determines how many blocks to look back for calculating S/R zones.
- S/R Zone Width (in ATR): Sets the thickness of the S/R zones, denominated in ATRs.
If you find this useful please reach out and let me know how you use it as it's fairly unique... and thus different than anything I've ever seen or used.
Open-source script
In true TradingView spirit, the creator of this script has made it open-source, so that traders can review and verify its functionality. Kudos to the author! While you can use it for free, remember that republishing the code is subject to our House Rules.
Disclaimer
The information and publications are not meant to be, and do not constitute, financial, investment, trading, or other types of advice or recommendations supplied or endorsed by TradingView. Read more in the Terms of Use.
Open-source script
In true TradingView spirit, the creator of this script has made it open-source, so that traders can review and verify its functionality. Kudos to the author! While you can use it for free, remember that republishing the code is subject to our House Rules.
Disclaimer
The information and publications are not meant to be, and do not constitute, financial, investment, trading, or other types of advice or recommendations supplied or endorsed by TradingView. Read more in the Terms of Use.