Structure Midline [@Mishu]

433
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.

คำจำกัดสิทธิ์ความรับผิดชอบ

ข้อมูลและบทความไม่ได้มีวัตถุประสงค์เพื่อก่อให้เกิดกิจกรรมทางการเงิน, การลงทุน, การซื้อขาย, ข้อเสนอแนะ หรือคำแนะนำประเภทอื่น ๆ ที่ให้หรือรับรองโดย TradingView อ่านเพิ่มเติมใน ข้อกำหนดการใช้งาน