OPEN-SOURCE SCRIPT

Market Structure (BOS on Break, HH/HL/LH/LL)

120
Market Structure (BOS on Break, HH/HL/LH/LL) is a clean and reactive market structure tool designed for traders who want clear visual feedback of trend direction and structure changes.

It automatically identifies:

Higher Highs (HH)

Higher Lows (HL)

Lower Highs (LH)

Lower Lows (LL)

Breaks of Structure (BOS) when price breaches previous swing levels.

✳️ Features

Automatic Structure Detection: Detects swing highs/lows based on your left/right pivot settings.

Break of Structure Alerts: Instantly updates bias when price breaks a previous swing level (no delay).

Real-Time BOS Response: Structure flips as soon as price takes out the previous high or low.

Color-Coded Bars: Bars can auto-paint white for bullish and black for bearish conditions.

Optional Fading Dots: Visual fading dots track trend duration and strength for quick bias reading.

Customizable Pivots: Choose how many bars to use for left/right swing confirmation.

Alerts: Fully configured for HH, HL, LH, LL, BOS Up, and BOS Down events.

⚙️ Inputs

Left Pivot Bars / Right Pivot Bars: Control how many candles define a valid swing point.

Paint Bars by Trend: Toggle bar coloring to match bullish or bearish bias.

Show Fading Trend Dots: Add fading dots that shrink and fade as a trend matures.

🔔 Alerts

Break of Structure Up / Down

Higher High (HH) confirmed

Higher Low (HL) confirmed

Lower High (LH) confirmed

Lower Low (LL) confirmed

🎯 Use Case

Perfect for:

Price action traders

Smart money concept (SMC) practitioners

Trend structure analysts

Scalpers and swing traders looking for quick structure flips.

🧠 Notes

Works on any timeframe and any instrument.

BOS signals update immediately when price breaks structure (no lag).

For additional BOS markers, you can uncomment the last few lines in the script to show arrows when structure breaks.

Aviso legal

As informações e publicações não devem ser e não constituem conselhos ou recomendações financeiras, de investimento, de negociação ou de qualquer outro tipo, fornecidas ou endossadas pela TradingView. Leia mais em Termos de uso.