BoS and CHoCH Market Structure MT5
- Indicators
-
Svitlana Zhyliaieva
✅ About AlgoLab
AlgoLab is an independent team of MQL developers and traders building tools for MetaTrader 4 and MetaTrader 5. We create indicators and Expert Advisors with a focus on clean charts, clear logic and practical everyday use.
✅ What We Build - Version: 1.0
BoS and CHoCH Market Structure marks the market structure directly on the chart: swing highs and lows, Break of Structure (BoS) and Change of Character (CHoCH). A swing is confirmed when it is the highest or the lowest of the chosen number of bars on each side. When a candle CLOSES beyond the last swing, the indicator draws a line from the swing to the breaking candle and labels it: BoS if the break goes in the direction of the current trend, CHoCH if it goes against it.
Features
- BoS (Break of Structure) - a close beyond the last swing in the direction of the current trend (trend continuation)
- CHoCH (Change of Character) - a close beyond the last swing against the current trend (a possible change of direction)
- Break by the candle CLOSE - a wick that only touches a swing does not count as a break
- Bullish and bearish events in separate colors; each of the four event types (bullish BoS, bullish CHoCH, bearish BoS, bearish CHoCH) can be switched on or off
- Adjustable swing strength - from 2 to 50 bars on each side: smaller values give more events, larger values give fewer and more significant ones
- Optional arrow on the breaking candle
- Optional HH / HL / LH / LL marks on the swings (each swing is compared with the previous swing of the same kind)
- Line style, line width and label size are adjustable
- Alerts for new events: pop-up window and/or push notification (off by default); alerts are sent only for new events on the live chart, not for the history loaded at start
- Works on any symbol and any timeframe; the structure is calculated on the timeframe of the chart
- Does not trade and does not use DLLs, files or web requests
How it works
- Everything is calculated on CLOSED bars. An event appears when the breaking candle closes, and it is not redrawn or moved afterwards.
- A swing is confirmed only after the chosen number of bars has passed on its right side, so the structure is always a few bars behind the price. This is how every swing-based structure works, and it is the price of avoiding false swings.
- The trend state is updated by every break, whether the event is shown or hidden, so switching event types on and off does not change what is BoS and what is CHoCH.
Inputs
- Swing strength - number of bars on each side of a swing (2-50). Default: 5
- Bars of history to analyse - how many past bars are analysed when the indicator loads (50-5000). Default: 500
- Show bullish BoS, Show bullish CHoCH, Show bearish BoS, Show bearish CHoCH - switch each event type on or off
- Show text labels (BoS / CHoCH) - the label on the line. Default: on
- Show an arrow on the breaking candle - Default: off
- Show HH / HL / LH / LL marks - marks on the swings. Default: off
- Bullish color, Bearish color - colors of the events
- Line style, Line width, Label font size - appearance
- Alerts on, Alert: pop-up window, Alert: push notification - alerts for new events. Default: off
Notes
- The indicator does not know the trend before the start of the analysed history, so the first event in the loaded history is always BoS. If the history length changes (for example after a reload with a different "Bars of history to analyse"), the type of the oldest events on the chart can change. Events on the live chart are not affected.
- Larger "Swing strength" values need more bars: with very short histories there may be no events at all.
- The events are drawn as chart objects; the indicator has no buffers for use in Expert Advisors.
- This is an analysis tool, not a trading signal. A break of structure does not guarantee that price will continue or reverse.
