OPEN-SOURCE SCRIPT
Aggiornato Market Structure CH / BOS

Market Structure CH / BOS
Automatic intraday market structure mapping — Change of Character (CH) and Break of Structure (BOS) — built for the New York regular session.
This indicator tracks the live trend structure of any intraday chart using a state machine that follows two key levels at all times:
BOS (Break of Structure): the most recent structural extreme in the direction of the trend. A close beyond it confirms trend continuation.
CH (Change of Character): the origin of the current impulse. A close beyond it flips the structure to the opposite direction.
In a bearish structure the CH sits above and the BOS below; in a bullish structure it's mirrored.
How it works
Closes only. Wicks never break a level — only a confirmed candle close validates a BOS or a CH break. Nothing is decided on the in-progress candle.
Daily reset. The indicator works exclusively during the 09:30–15:59 New York regular session. The 09:30 candle sets the initial range, logic starts at 09:31, and everything is cleared and reinitialized at the next day's open. Outside the session, structure and drawings freeze.
Initialization. While direction is undefined, the day's running high/low are tracked. The first close below the opening low starts a bearish structure (and the first close above the opening high, a bullish one).
Continuation (BOS break): the BOS moves to the new extreme. The CH only advances if the prior pullback was significant.
Flip (CH break): the structure reverses, and the new CH is anchored to the absolute extreme of the finished phase — where the reversal impulse was actually born.
Minimum Pullback Filter
A standout feature: the Minimum Retracement (%) input. Small, single-candle dips inside the same impulse used to drag the CH around incorrectly. This filter measures each pullback as a percentage of the CH→BOS leg and only moves the CH when the retracement is real:
A ~63% rebound → moves the CH.
A ~20% dip → ignored as noise.
Configurable from 10% to 90% (default 35%).
Inputs
Regular session — session window (default 0930–1600 NY).
CH / BOS colors and line thickness (1–4).
Line extension — how many candles forward the levels project (default 15).
Minimum retracement (%) — the pullback filter described above.
Notes
Designed for intraday timeframes only.
Only the active CH/BOS pair is shown; previous levels are removed to keep the chart clean.
Times are fixed to the America/New_York timezone regardless of your chart's local time.
Automatic intraday market structure mapping — Change of Character (CH) and Break of Structure (BOS) — built for the New York regular session.
This indicator tracks the live trend structure of any intraday chart using a state machine that follows two key levels at all times:
BOS (Break of Structure): the most recent structural extreme in the direction of the trend. A close beyond it confirms trend continuation.
CH (Change of Character): the origin of the current impulse. A close beyond it flips the structure to the opposite direction.
In a bearish structure the CH sits above and the BOS below; in a bullish structure it's mirrored.
How it works
Closes only. Wicks never break a level — only a confirmed candle close validates a BOS or a CH break. Nothing is decided on the in-progress candle.
Daily reset. The indicator works exclusively during the 09:30–15:59 New York regular session. The 09:30 candle sets the initial range, logic starts at 09:31, and everything is cleared and reinitialized at the next day's open. Outside the session, structure and drawings freeze.
Initialization. While direction is undefined, the day's running high/low are tracked. The first close below the opening low starts a bearish structure (and the first close above the opening high, a bullish one).
Continuation (BOS break): the BOS moves to the new extreme. The CH only advances if the prior pullback was significant.
Flip (CH break): the structure reverses, and the new CH is anchored to the absolute extreme of the finished phase — where the reversal impulse was actually born.
Minimum Pullback Filter
A standout feature: the Minimum Retracement (%) input. Small, single-candle dips inside the same impulse used to drag the CH around incorrectly. This filter measures each pullback as a percentage of the CH→BOS leg and only moves the CH when the retracement is real:
A ~63% rebound → moves the CH.
A ~20% dip → ignored as noise.
Configurable from 10% to 90% (default 35%).
Inputs
Regular session — session window (default 0930–1600 NY).
CH / BOS colors and line thickness (1–4).
Line extension — how many candles forward the levels project (default 15).
Minimum retracement (%) — the pullback filter described above.
Notes
Designed for intraday timeframes only.
Only the active CH/BOS pair is shown; previous levels are removed to keep the chart clean.
Times are fixed to the America/New_York timezone regardless of your chart's local time.
Note di rilascio
Settings in englishNote di rilascio
Added time zone as inputNote di rilascio
little fixNote di rilascio
Update in timezoneNote di rilascio
fixScript open-source
Nello spirito di TradingView, l'autore di questo script lo ha reso open source, in modo che i trader possano esaminarne e verificarne la funzionalità. Complimenti all'autore! Sebbene sia possibile utilizzarlo gratuitamente, ricordiamo che la ripubblicazione del codice è soggetta al nostro Regolamento.
Declinazione di responsabilità
Le informazioni e le pubblicazioni non sono intese come, e non costituiscono, consulenza o raccomandazioni finanziarie, di investimento, di trading o di altro tipo fornite o approvate da TradingView. Per ulteriori informazioni, consultare i Termini di utilizzo.
Script open-source
Nello spirito di TradingView, l'autore di questo script lo ha reso open source, in modo che i trader possano esaminarne e verificarne la funzionalità. Complimenti all'autore! Sebbene sia possibile utilizzarlo gratuitamente, ricordiamo che la ripubblicazione del codice è soggetta al nostro Regolamento.
Declinazione di responsabilità
Le informazioni e le pubblicazioni non sono intese come, e non costituiscono, consulenza o raccomandazioni finanziarie, di investimento, di trading o di altro tipo fornite o approvate da TradingView. Per ulteriori informazioni, consultare i Termini di utilizzo.