The Break of Structure CHOCH Indicator watches price close through the last confirmed swing. It calls that close a break of structure when the move extends the trend. A close against the trend reads as a change of character instead. Each event leaves a labelled line at the level that gave way.
This build ships as a compiled .ex4 for MT4 and .ex5 for MT5; the screenshots below come from EURUSD H1.
| Platforms | MT4 (.ex4) + MT5 (.ex5) |
|---|---|
| Chart window | Main price chart |
| Plots | 2: BoS / CHoCH (BUY), BoS / CHoCH (SELL) |
| Alerts | popup, push notification, email, sound |
| Inputs | 16 |
What renders
Two arrow buffers carry the signals. BoS / CHoCH (BUY) drops a lime up arrow under the breakout bar. BoS / CHoCH (SELL) drops a red down arrow above it. ArrowOffsetPts sets the gap in points, so each marker clears the candle.
Alongside the markers the code writes chart objects. A horizontal trend line runs from the broken swing bar to the breakout bar. A short text tag beside it names the event and its direction.
Colour separates continuation from reversal. ColorBosBull and ColorBosBear paint the continuation lines. ColorChochBull and ColorChochBear paint the reversal lines. Turn DrawStructureLines off and only the arrows remain.
- BoS / CHoCH (BUY): arrow, lime, width 2, arrow code 233
- BoS / CHoCH (SELL): arrow, red, width 2, arrow code 234

How each value gets built
Fractal swing detection
Swings come first. A bar holds a swing high when its high beats every neighbour on both sides. LeftBars counts the older side and RightBars counts the newer one. Swing lows run the mirror test on the low. Both settings sit at five out of the box.
Because the newer side must fill in, a pivot confirms several bars late. That delay belongs to the fractal definition rather than to this build.
Reading the close against stored swings
Classification runs on closed bars only. The code keeps the last swing high, the last swing low and a trend flag. A close above the stored high with the flag already up counts as a break of structure. The same close after a down flag counts as a change of character.
Once an up event fires, the code clears that swing high. The flag then points up. A new pivot has to form before the next up event prints. Down events follow the mirror rule against the stored swing low.
Chart object housekeeping
Every event costs two objects. MaxStructureLines caps how many stay on screen. The code deletes the oldest pair once the total passes twice that cap. LineWidth controls how heavy the horizontal lines look.
Getting a read from it
A lime arrow means price closed above the last stored swing high. Read the text tag before you act. Both event types share the same arrow code.
Continuation and reversal ask for different plans. A break of structure suits trend traders adding to an existing bias. A change of character suits traders hunting the turn itself.
The broken level keeps working after the event. Price often drifts back to that horizontal line. The retest gives a tighter entry than the breakout close does. Fast sessions skip the retest, so treat it as an option.
Alert channels in this build: popup, push notification, email and sound, one message per closed bar.
EnableAlerts drives four channels: popup, push notification, email and sound. Each has its own toggle in the inputs panel. The guard keys on the event bar, so one message goes out per closed bar.
Every Break of Structure CHOCH Indicator input
Core settings
| Setting | What it does | Default |
|---|---|---|
LeftBars |
Bars to the left of pivot. Bars a pivot must beat on its older side. Raise it for major swings only. | 5 |
RightBars |
Bars to the right of pivot. Bars the pivot must beat on its newer side. A larger count adds confirmation delay. | 5 |
MaxStructureLines |
Recycle oldest beyond this cap. Ceiling on stored structure objects. Drop it on slow machines, since each event holds two. | 60 |
Display settings
| Setting | What it does | Default |
|---|---|---|
ArrowOffsetPts |
Arrow vertical offset (points). Vertical space in points between candle and arrow. Widen it on gold or indices. | 35 |
DrawStructureLines |
Draw horizontal break levels. Master switch for the horizontal levels and tags. Turn it off for arrows alone. | on |
ColorBosBull |
BoS bull line + label. | lime |
ColorBosBear |
BoS bear line + label. | tomato |
ColorChochBull |
CHoCH bull line + label. | aqua |
ColorChochBear |
CHoCH bear line + label. | magenta |
LineWidth |
(see inputs panel) | 1 |
Alert settings
| Setting | What it does | Default |
|---|---|---|
EnableAlerts |
(see inputs panel) | on |
EnablePopup |
(see inputs panel) | on |
EnablePushNotify |
(see inputs panel) | off |
EnableEmail |
(see inputs panel) | off |
EnableSound |
(see inputs panel) | off |
SoundFile |
(see inputs panel) | alert.wav |

Picking a chart for it
Fractal structure needs real swings. EURUSD on H1 gives a fair reading of this build. Lower charts such as M5 produce more pivots and more noise. H4 and D1 thin the count down to swings that matter. Indices and gold work as well, though wider candles call for a bigger ArrowOffsetPts.
Where it disappoints
Ranges punish this logic. Price pokes above a swing high, closes there, then rolls straight back. The marker stays on the chart as a failed break. Tight consolidations print several of these in a row.
The confirmation delay cuts both ways. A pivot needs closed bars on its newer side before it counts. A fast reversal can travel far before any level exists to break.
Events also depend on stored state. After an up break the code wipes that swing high. A second push in the same direction stays silent until a fresh pivot forms. Strong trends can leave the chart quiet through the fastest leg.
Structure labels describe the past. Naming a close a change of character says nothing about the distance ahead.
Copy the compiled Break of Structure CHOCH Indicator file into your MQL4/Indicators folder, and the MT5 build into MQL5/Indicators, then restart the terminal and drag it onto a chart. The step-by-step guide with screenshots is at how to install MT4 and MT5 indicators.
Download the Break of Structure CHOCH Indicator for MT4 and MT5
The zip holds the compiled Break of Structure CHOCH Indicator build for MT4 and MT5, plus a short README. Compiled files only, no source. Enter your email below and the download link arrives in your inbox.
Download this indicator free
Enter your email and the file is yours. You also get the full MT4 and MT5 library.
FAQ
How many bars do LeftBars and RightBars need before a swing counts?
Both sit at five in the shipped build. A bar must beat the five highs behind it and the five in front. The newer side fills in five bars later. Raise both numbers for rarer, cleaner pivots. Drop them to three on fast charts where you want more events.
Which label separates a break of structure from a change of character?
The text tag on the horizontal line carries the answer. A break of structure means the close extended the trend already flagged in the code. A change of character means the close ran against that flag. Both events share the same arrow codes, so the tag matters more than the marker.
Does the horizontal line move after DrawStructureLines paints it?
No. The line anchors to the swing bar that price broke. It ends on the bar that closed through that level. Both bars have finished by then. The count on screen can change, because MaxStructureLines trims the oldest pair once the cap fills.
Why did the arrow appear several bars after the swing formed?
The pivot rule needs a run of closed bars on the newer side. Until those bars print, the level does not exist for the break test. On a five-bar setting the stored level trails the actual high by five bars. The marker can only fire after that.
Are results guaranteed?
No. Trading involves risk. Results are not guaranteed; past performance is not indicative of future results. Use the Break of Structure CHOCH Indicator as one input. Always backtest before trading live.
type: this is part of our Smart Money collection. Thus, plainly, browse more Smart Money for MetaTrader, or explore every MT4 indicator and MT5 indicator on the site.
External references
- The core method is documented in Three Line Break Charts at StockCharts ChartSchool.
- Additional market context is at Smart money index on Wikipedia.
