OPEN-SOURCE SCRIPT
Structure Pro by Murshidfx

Inspired by the 'mentfx Structure' indicator created by Anton (mentfx) on TradingView,
## Overview
Structure Pro tracks market structure by maintaining an adaptive dealing range and its midpoint. Swing highs and lows become structural boundaries, and the script responds to confirmed breakouts by recalculating the active range. Labels highlight the latest trend flip so the chart stays readable while the range evolves.
## Core Logic
- Detects swing highs/lows using a configurable pivot strength and promotes confirmed pivots to structural levels.
- Applies a percentage buffer to decide when price truly breaks structure; once triggered, the opposite boundary is recalculated with an anchor search that looks back through historical bars.
- Computes equilibrium as the midpoint between the current structural high and low so you can gauge premium versus discount zones.
- Emits a single BULL or BEAR label when the trend state changes, keeping only the most recent signal on the chart.
## How to Use
1. Open a clean chart and apply only this script.
2. Select a swing strength that matches the scale you want to monitor (lower values for responsive intraday swings, higher values for broader moves).
3. Tune the structure sensitivity percentage if you prefer tighter or looser confirmation before declaring a breakout.
4. Track DRH/DRL for the current dealing range, use the equilibrium line as a mean-reversion guide, and look to the BULL/BEAR label for structure confirmation.
5. Combine the levels with your own execution, risk, and position rules—this script does not manage orders.
## Inputs
- Swing Point Strength: bars required on both sides to confirm a pivot.
- Structure Break Sensitivity: percentage buffer applied to the range before calling a breakout.
- Dealing Range display: toggles for visibility, line width/color, label text, and label size.
- Equilibrium display: line style, width, and color controls.
- Trend Signals: enable/disable labels, adjust text size, and pick label colors.
## Notes
- Designed for live structure tracking; the script relies on confirmed pivots and does not peek into future data.
- Built to be chart-agnostic for standard candles; non-standard chart types can distort the measurements.
- Published open-source so traders can review and verify the implementation details.
## Overview
Structure Pro tracks market structure by maintaining an adaptive dealing range and its midpoint. Swing highs and lows become structural boundaries, and the script responds to confirmed breakouts by recalculating the active range. Labels highlight the latest trend flip so the chart stays readable while the range evolves.
## Core Logic
- Detects swing highs/lows using a configurable pivot strength and promotes confirmed pivots to structural levels.
- Applies a percentage buffer to decide when price truly breaks structure; once triggered, the opposite boundary is recalculated with an anchor search that looks back through historical bars.
- Computes equilibrium as the midpoint between the current structural high and low so you can gauge premium versus discount zones.
- Emits a single BULL or BEAR label when the trend state changes, keeping only the most recent signal on the chart.
## How to Use
1. Open a clean chart and apply only this script.
2. Select a swing strength that matches the scale you want to monitor (lower values for responsive intraday swings, higher values for broader moves).
3. Tune the structure sensitivity percentage if you prefer tighter or looser confirmation before declaring a breakout.
4. Track DRH/DRL for the current dealing range, use the equilibrium line as a mean-reversion guide, and look to the BULL/BEAR label for structure confirmation.
5. Combine the levels with your own execution, risk, and position rules—this script does not manage orders.
## Inputs
- Swing Point Strength: bars required on both sides to confirm a pivot.
- Structure Break Sensitivity: percentage buffer applied to the range before calling a breakout.
- Dealing Range display: toggles for visibility, line width/color, label text, and label size.
- Equilibrium display: line style, width, and color controls.
- Trend Signals: enable/disable labels, adjust text size, and pick label colors.
## Notes
- Designed for live structure tracking; the script relies on confirmed pivots and does not peek into future data.
- Built to be chart-agnostic for standard candles; non-standard chart types can distort the measurements.
- Published open-source so traders can review and verify the implementation details.
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.