What is a break of structure in trading?
Higher highs and higher lows are one way to define an uptrend; lower highs and lower lows define a downtrend. A usable BOS rule also needs a precise way to select those swings. Two indicators using different pivot lengths can label different breaks on the same chart. A range breakout has no established directional trend by definition, so record it separately until your trend-state rule changes. These are analytical conventions, not exchange classifications.
| Prior state | Reference level | Close-based event | What remains unknown |
|---|
| Uptrend | Previously confirmed swing high | Close above that high: bullish BOS | Whether the next bars continue upward |
| Downtrend | Previously confirmed swing low | Close below that low: bearish BOS | Whether the next bars continue downward |
| Range or uninitialized | Selected range boundary | Range breakout, recorded separately | Whether a trend develops |
Bullish BOS vs Bearish BOS mechanics
The direction of a break is visible in price data. The identity, intent and remaining orders of market participants are not. A bullish break can fail on the next bar; a bearish break can reverse without returning to a chosen entry zone. Comparing an immediate entry with a retracement entry requires separate rules and separate accounting for trades that never fill.
- Bullish rule: an uptrend must already exist, and the completed close must exceed the selected high
- Bearish rule: a downtrend must already exist, and the completed close must fall below the selected low
- One-event rule: mark a reference level as consumed after its first qualifying break if repeated signals are not intended
- Invalidation rule: define which opposing swing changes the trend state; do not select it retrospectively
Closing-price breaks versus wick breaches
A closing-price rule requires only the close beyond the level, not the entire candle body. For example, an open below a swing high and a close above it qualifies under this rule. A wick-only breach does not. Calling that breach a liquidity sweep is an SMC interpretation; OHLC bars alone do not show whether stops traded or whether anyone engineered the move. Waiting for the close changes signal timing but cannot eliminate failed breakouts.
| Observed price action | Classification here | What it establishes | Test treatment |
|---|
| Close beyond the reference swing | Qualifying BOS if prior trend agrees | The completed closing price crossed the level | Record signal and next eligible order time |
| Wick beyond the level, close back inside | No close-based BOS | An intrabar excursion and return | Do not count a trade under this rule |
| Close exactly at the level | No strict break | Equality, not a greater/less-than event | Apply the same equality rule in all samples |
Major swing BOS vs minor internal BOS
Major and internal structure are relative to the swing detector and timeframe. A five-minute uptrend can occur inside a declining daily swing. Higher-timeframe alignment is an optional strategy filter, not evidence of a higher win probability by itself. If daily information guides an intraday entry, use only daily values available at that moment; the final daily close is not known during the session.
- Record reference timeframe, entry timeframe and pivot lengths in the test specification
- Use confirmed higher-timeframe values when the method requires a completed higher-timeframe bar
- Compare an alignment filter against the same rules without it, including reduced trade count
- Keep conflicting-timeframe examples and losing trades in the evaluation
Building a break of structure trading strategy
Start with a signal specification, then define an order model. A BOS label alone has no entry price, stop, target or holding period. Order blocks and fair value gaps are optional additional conditions; they are not prerequisites for the definition used here. The following workflow can be tested without assuming that every break retraces or that every touched limit fills.
- Context: define trend state from confirmed swings and specify how the first state is initialized
- Signal: freeze the reference swing, require a completed close beyond it and timestamp when it became observable
- Entry: choose next-bar market execution or a retracement order with an explicit expiry; record missed entries
- Exit and evaluation: define stop, target, time exit, sizing, commission and slippage; reserve unseen data and retain failed breaks
Quantifying BOS rules in Pine Script
Pineify AI Coding Agent can draft Pine Script from a written BOS specification. Compilation and chart comparison are still necessary: syntactically valid code can use future information or implement a different swing rule. A pivot with five bars on its right becomes available five bars after the pivot bar. Drawing a label back on that earlier bar does not make the signal tradable then.
- Specify left/right pivot lengths, equality handling and the confirmation timestamp
- A comparison such as close > swing_high can change while the realtime bar is open; require bar confirmation when intended
- Review higher-timeframe requests and avoid future-value leakage; bar-close gating alone does not solve every repainting cause
- Use TradingView strategy settings for costs and fills, then compare historical, replay and forward observations