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.
免责声明
这些信息和出版物并非旨在提供,也不构成TradingView提供或认可的任何形式的财务、投资、交易或其他类型的建议或推荐。请阅读使用条款了解更多信息。
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.
免责声明
这些信息和出版物并非旨在提供,也不构成TradingView提供或认可的任何形式的财务、投资、交易或其他类型的建议或推荐。请阅读使用条款了解更多信息。