Structure Midline [@Mishu]

Structure Midline follows the market structure leg by leg and draws the midpoint between the last leg high and the last leg low.
How it works
- An up-leg starts when price closes above the high of the previous bar(s); a down-leg starts with a close below the low. The lookback is adjustable (1 = behavior of my original Entry Helper).
- During an up-leg the indicator tracks the highest high (top), during a down-leg the lowest low (bottom).
- Midline = (top + bottom) / 2. Price above the midline = upper half, below = lower half (optionally shaded).
- Optional: a minimum breakout distance in ATR units ignores marginal breaks.
- Structure flips (first up-leg after a down-leg and vice versa) are marked after bar close.
Alerts
Structure flip up / down, close above / below midline - once per bar close.
Limitations
Top and bottom are updated while a leg is running. The midline therefore moves with new extremes - that is by design and not repainting of past values. With a lookback of 1 the structure flips often in sideways markets; higher lookback values or the ATR filter reduce this.
This is a rewritten successor of my earlier "Entry Helper" script (Pine Script v6).
This script is an analysis tool. It does not provide financial advice or trade recommendations.
How it works
- An up-leg starts when price closes above the high of the previous bar(s); a down-leg starts with a close below the low. The lookback is adjustable (1 = behavior of my original Entry Helper).
- During an up-leg the indicator tracks the highest high (top), during a down-leg the lowest low (bottom).
- Midline = (top + bottom) / 2. Price above the midline = upper half, below = lower half (optionally shaded).
- Optional: a minimum breakout distance in ATR units ignores marginal breaks.
- Structure flips (first up-leg after a down-leg and vice versa) are marked after bar close.
Alerts
Structure flip up / down, close above / below midline - once per bar close.
Limitations
Top and bottom are updated while a leg is running. The midline therefore moves with new extremes - that is by design and not repainting of past values. With a lookback of 1 the structure flips often in sideways markets; higher lookback values or the ATR filter reduce this.
This is a rewritten successor of my earlier "Entry Helper" script (Pine Script v6).
This script is an analysis tool. It does not provide financial advice or trade recommendations.
Mishundare – Pine Script developer (IntelligenceFlow). My scripts are analysis tools: no signals, no financial advice, no performance promises. Questions or bugs? Leave a comment under the script.
Pernyataan Penyangkalan
Informasi dan publikasi ini tidak dimaksudkan, dan bukan merupakan, saran atau rekomendasi keuangan, investasi, trading, atau jenis lainnya yang diberikan atau didukung oleh TradingView. Baca selengkapnya di Ketentuan Penggunaan.
Mishundare – Pine Script developer (IntelligenceFlow). My scripts are analysis tools: no signals, no financial advice, no performance promises. Questions or bugs? Leave a comment under the script.
Pernyataan Penyangkalan
Informasi dan publikasi ini tidak dimaksudkan, dan bukan merupakan, saran atau rekomendasi keuangan, investasi, trading, atau jenis lainnya yang diberikan atau didukung oleh TradingView. Baca selengkapnya di Ketentuan Penggunaan.