OPEN-SOURCE SCRIPT

Structure Break Chain (SBC) [SharpStrat]

717
Structure Break Chain (SBC)

Every trader has been there. You're in a trade, the trend looks healthy, and then suddenly price flips on you. You had no warning. You held too long. The trend was already breaking down you just couldn't see it clearly enough.
That's exactly what Structure Break Chain was built to solve.
SBC is a market structure tracking tool that reads how price is actually moving swing by swing, break by break and builds a real-time picture of trend health. Not with a smoothed line or a lagging oscillator, but by watching the raw structure of the market, the sequence of higher highs and lower lows that every trend is made of.

What is a Break of Structure (BOS)?

In any uptrend, price makes a series of higher highs. Every time price closes above a previous swing high, that's a Break of Structure confirmation that the bull trend is still alive and continuing. In a downtrend, it's the opposite: price keeps breaking below previous swing lows.
SBC detects every single one of these breaks automatically and marks them on your chart with a labeled arrow green for bullish, red for bearish. No manual drawing. No guessing.
ảnh chụp nhanh
What is a CHoCH (Change of Character)?

A CHoCH fires when price breaks structure in the opposite direction to the current trend for the first time. In a bull trend, that means price has just broken below a prior swing low. That single event doesn't confirm a full reversal but it's the earliest possible warning that something has changed in the market's behavior.
Most indicators won't catch this until several bars later. SBC marks it the moment it happens, in yellow so it stands out from the regular BOS signals as shown in the image below.
ảnh chụp nhanh
The Chain Counter

Here's what makes SBC different from a standard structure indicator.
Every time a BOS happens in the same direction without interruption, the chain count goes up by 1. When a CHoCH happens, the chain resets to 1 and starts counting in the new direction.
A chain of 4 means price has broken structure 4 times in a row in the same direction. That's a mature, committed trend. A chain of 1 after a CHoCH means the new trend is unproven and fragile you should be cautious about entries.
A live label on the right edge of your chart shows the current chain count in real time as shown in image above. It updates every bar.

Break Quality Score

When price barely scrapes past a swing level by a few ticks on low momentum, that's a very different signal from a strong, high-volume candle closing well beyond the level.
SBC scores every break as STRONG, NORMAL, or WEAK based on two factors:
  • How far price closed beyond the broken level (relative to ATR)
  • How large and decisive the breaking candle's body was

STRONG breaks have brighter, more vivid label colors. WEAK breaks are dimmed and semi-transparent as shown in image below. This lets you visually filter the breaks that matter from the noise.
ảnh chụp nhanh
Failed BOS

Sometimes price breaks a level, you get excited, and then it immediately reverses back inside. That's a trap and it's one of the most common ways retail traders get hurt.
SBC watches every confirmed break for the next 1-3 bars (adjustable). If price closes back inside the broken level within that window, the indicator marks it as a FAILED break in purple as shown in image above. This is your earliest possible warning that the breakout wasn't real, often appearing few bars before the CHoCH confirms the reversal.
Using Failed BOS + CHoCH together gives you two layers of confirmation before you act on a potential trend change.

Pullback Entry Zones

After every confirmed BOS, SBC draws a semi-transparent box between the broken level and the previous swing reference as shown in image below. This is the area where price is most likely to pull back before continuing in the trend direction, the optimal entry zone.
The box extends forward by a user defined number of bars and disappears automatically when a new BOS or CHoCH occurs.
ảnh chụp nhanh
Multi-Timeframe Overlay

You can optionally enable a higher timeframe (HTF) structure overlay. When turned on, SBC also tracks BOS and CHoCH events from your chosen higher timeframe and plots them directly on your current chart as dimmed labels as shown in image above, so you always know what the bigger picture is doing.
Note: HTF labels are designed to appear only once per HTF bar, not on every sub-bar. So on a 15-minute chart with a 1-hour HTF, you'll see the HTF label appear once on the first 15-minute candle of that hour not repeated across all four candles.
The dashboard also shows whether your current timeframe trend and the HTF trend are aligned or in conflict. Trading a bull BOS on the 15-minute chart while the 1-hour is bearish is a generally riskier than when both are pointing in same direction.

The Dashboard Panel

A compact information table sits in the corner of your chart (position is adjustable). It shows everything at a glance without you having to read the price action:
  • Current trend direction (Bullish / Bearish / Neutral)
  • Live chain count
  • Quality of the last break (STRONG / NORMAL / WEAK)
  • HTF direction and alignment status
  • HTF chain count
  • Maximum chain ever recorded on this chart
  • Average chain length across all completed trends
  • Total BOS count
  • Total CHoCH count

The chain count in the table turns yellow when it reaches your milestone number (customizable in settings) a visual nudge that the trend is mature.

How to use SBC
  1. Wait for a CHoCH, this is your signal that the previous trend is over and a new one may be starting. Don't trade it immediately.
  2. Watch the first BOS in the new direction if it's STRONG quality, that's confirmation the new trend has real momentum behind it.
  3. Look for a pullback into the entry zone, the green or red dashed box SBC draws is your optimal entry area.
  4. Check the chain count, if you're entering at chain count 1 you're probably early. If you're entering at 6 or 7 the trend is probably mature and a reversal is likely so adjust your expectations accordingly.
  5. Check HTF alignment, if both your timeframe and the higher timeframe are showing the same direction, the trade has more conviction behind it.
  6. Watch for Failed BOS and CHoCH these are your exit warnings. A Failed BOS followed by a CHoCH is a reliable signal to close or tighten your stop.


Settings guide

Structure settings
  • Pivot Length - how many bars left and right are needed to confirm a swing high or low. Higher values = fewer but cleaner pivots.
  • BOS Confirmation - "Close" waits for a candle to close beyond the level (safer, recommended). "High/Low" triggers on the wick (faster but noisier).
  • Failed BOS Window - how many bars after a break to watch for failure.
  • Show Swing Lines - draws dashed horizontal lines at each detected pivot.
  • Show Pullback Entry Zones - draws the dashed box after each BOS.
  • Zone Extend Right - how far the zone box extends to the right in bars.
  • Shade Trend Background - adds a background color based on current trend direction.

Visual settings
  • Full color customization for Bull, Bear, CHoCH, Failed BOS, and Swing Lines.
  • Toggle quality labels, chain bubble, and dashboard panel on/off.
  • Choose dashboard position (Top Right / Top Left / Bottom Right / Bottom Left).
  • Adjust label size.

Multi-timeframe settings
  • Enable or disable HTF overlay.
  • Choose any HTF timeframe.
  • Adjust HTF label transparency.


Why this is better than basic Structure break indicators
Most structure indicators on TradingView detect BOS and CHoCH but stop there. SBC adds three things:
  1. A chain counter that tracks consecutive structural breaks turning raw signals into a measure of trend maturity and health over time.
  2. A break quality scoring system that grades every break on two factors so you aren't chasing noise.
  3. A Failed BOS detector that watches the confirmed break for the next few bars and warns you before the CHoCH even happens giving you a head start that most traders don't have.

Note - Works on all markets and timeframes. Stocks, forex, crypto, indices, futures etc, if it has candles SBC probably works on it. The pivot length and ATR based quality scoring adapt automatically to the volatility of whatever asset you apply it to.

Thông báo miễn trừ trách nhiệm

Thông tin và các ấn phẩm này không nhằm mục đích, và không cấu thành, lời khuyên hoặc khuyến nghị về tài chính, đầu tư, giao dịch hay các loại khác do TradingView cung cấp hoặc xác nhận. Đọc thêm tại Điều khoản Sử dụng.