OPEN-SOURCE SCRIPT
Telah dikemas kini 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.
Nota Keluaran
Settings in englishNota Keluaran
Added time zone as inputNota Keluaran
little fixNota Keluaran
Update in timezoneNota Keluaran
fixSkrip sumber terbuka
Dalam semangat TradingView sebenar, pencipta skrip ini telah menjadikannya sumber terbuka, jadi pedagang boleh menilai dan mengesahkan kefungsiannya. Terima kasih kepada penulis! Walaupuan anda boleh menggunakan secara percuma, ingat bahawa penerbitan semula kod ini tertakluk kepada Peraturan Dalaman.
Penafian
Maklumat dan penerbitan adalah tidak bertujuan, dan tidak membentuk, nasihat atau cadangan kewangan, pelaburan, dagangan atau jenis lain yang diberikan atau disahkan oleh TradingView. Baca lebih dalam Terma Penggunaan.
Skrip sumber terbuka
Dalam semangat TradingView sebenar, pencipta skrip ini telah menjadikannya sumber terbuka, jadi pedagang boleh menilai dan mengesahkan kefungsiannya. Terima kasih kepada penulis! Walaupuan anda boleh menggunakan secara percuma, ingat bahawa penerbitan semula kod ini tertakluk kepada Peraturan Dalaman.
Penafian
Maklumat dan penerbitan adalah tidak bertujuan, dan tidak membentuk, nasihat atau cadangan kewangan, pelaburan, dagangan atau jenis lain yang diberikan atau disahkan oleh TradingView. Baca lebih dalam Terma Penggunaan.