Guarda come scaricare robot di trading gratuitamente
Ci trovi su Facebook!
Unisciti alla nostra fan page
Script interessante?
Pubblica il link!
lasciare che altri lo valutino
Ti è piaciuto lo script? Provalo nel Terminale MetaTrader 5
Indicatori

Smart Money Concepts BOS CHoCH - indicatore per MetaTrader 5

Cristhian Alexander Gaibor Cuasquer
Cristhian Alexander Gaibor Cuasquer
  • Founder & Systems Engineer al  Xander Pro
  • Ecuador
  • 6774
4.9 (30)
Trader e membro di MQL5 dal 2017.
Visualizzazioni:
156
Valutazioni:
(1)
Pubblicato:
Freelance MQL5 Hai bisogno di un robot o indicatore basato su questo codice? Ordinalo su Freelance Vai a Freelance

Market structure on Gold (XAUUSD), EURUSD or any chart, read from closed candles only. A swing high or low is confirmed when N candles on each side are lower or higher, and every swing gets its label: HH, HL, LH or LL. When a candle closes beyond the last swing, the break is drawn from that swing to the breaking candle.

A close above the last swing high in a bullish structure is a BOS (break of structure). The same close in a bearish structure is a CHoCH (change of character) and flips the trend. Each break can fire a pop-up, push or sound alert on the candle that just closed, and is written to four buffers an EA can read with iCustom.

A swing needs N closed candles after it, so labels appear with that delay and the forming candle never paints anything. This is the basic structure layer on purpose: no order blocks, no fair value gaps, no liquidity sweeps. Use it as context, not as an entry signal by itself.

Smart Money Concepts BOS CHoCH indicator on a MetaTrader 5 chart with HH HL LH LL labels

Settings

Structure

  • Swing length (5): candles on each side of a swing high or low. 3 gives more swings and more breaks, 10 keeps only the big ones.
  • Bars to analyze (1500): how many bars from the right are processed. 0 means all history.

Display

  • Draw BOS lines and Draw CHoCH lines (true): turn each type on or off. BOS is dotted, CHoCH is solid, both styles can be changed.
  • Label swings (true): HH, HL, LH and LL text on every confirmed swing.
  • Show arrow buffers (false): draws the four buffers as dots and circles on the chart. Off by default because the lines already show the same thing. The buffers are filled either way.
  • Bullish color, Bearish color, Swing label color, Line width, Label font size.

Alerts

  • Pop-up, Push notification and Sound (all false): one message per break, only for the candle that just closed. History breaks never alert.
  • Sound file (alert.wav).

Indicator settings

  • Object prefix (XP_SMC_): every line and label starts with it, and only those objects are removed when you take the indicator off. To run two copies on one chart, for example swing 5 and swing 20, give each one its own prefix.

What it needs

  • MetaTrader 5, any symbol, any timeframe, any account type. It is an indicator, it does not trade.
  • Enough history for the swing length you choose: at least two times the swing length plus two bars.
  • For EAs, the buffers are: 0 BOS up, 1 BOS down, 2 CHoCH up, 3 CHoCH down. The value is the low of the breaking candle for bullish breaks and the high for bearish ones. Every other bar holds EMPTY_VALUE.

Make it yours

Load it on XAUUSD H1 and M15 at the same time and see how often the M15 CHoCH comes before the H1 one. Run the same test on EURUSD, GBPUSD, US30, NAS100 or BTCUSD, the swing length that reads one market well is rarely the best for another. If you trade with Smart Money Concepts, this is the layer you build on: add your own order blocks at the candle before each CHoCH, mark fair value gaps, or filter breaks by session so only London and New York count. If you write EAs, call it with iCustom and use buffer 2 or 3 as a trend flip filter for your entries, or use BOS in the same direction as a continuation condition. The swing detection and the break logic are two short functions that can be copied into your own code as they are.

About this code

Open source. Use it as it is, adapt it, build your own version on top of it.

New versions and new tools are announced first on my MQL5 channel: https://www.mql5.com/en/channels/xander

Questions, suggestions and your own backtests are welcome in the Xander Lab group: https://www.mql5.com/en/messages/02eec85e4364dd01

More tools on my profile: https://www.mql5.com/en/users/09151993a

Provided as is, use at your own risk.

Related

Changelog

  • v1.0 - 2026-10-25 - Initial release
Tick Scalper Helper - tick chart and one-click trading panel for MetaTrader 5 Tick Scalper Helper - tick chart and one-click trading panel for MetaTrader 5

Tick Scalper Helper is a manual trading utility for traders who work on very short time frames and want to see every price change.

Supertrend Scalper with Breakeven Win Rate Panel Supertrend Scalper with Breakeven Win Rate Panel

A Supertrend scalping EA with 14 switchable filters and a self-measuring panel that shows the actual win rate next to the win rate needed to break even after real spread, so you can see whether a setting has an edge or only a high percentage.

Heikin Ashi Candles Heikin Ashi Candles

A clean Heikin Ashi indicator that draws on the main chart window. It also adds one horizontal line at the average price, (Open + High + Low + Close) / 4, of the last closed candle of a chosen timeframe. By default this is H1, and the line uses the normal candles, not Heikin Ashi.

Broker Time - server, UTC, New York, London, Sydney, Tokyo with the right summer time (class + session lines) Broker Time - server, UTC, New York, London, Sydney, Tokyo with the right summer time (class + session lines)

CBrokerTime converts server time, UTC, New York, London, Sydney and Tokyo with the real summer time of every year and finds your broker's clock from the history (also in the tester). The indicator draws session lines and a clock panel.