Watch how to download trading robots for free
Find us on Facebook!
Join our fan page
Interesting script?
So post a link to it -
let others appraise it
You liked the script? Try it in the MetaTrader 5 terminal
Indicators

Order Blocks Zones SMC - indicator for MetaTrader 5

Cristhian Alexander Gaibor Cuasquer
Cristhian Alexander Gaibor Cuasquer
  • Founder & Systems Engineer at  Xander Pro
  • Ecuador
  • 7690
4.8 (38)
Trader and MQL5 member since 2017.
Views:
41
Rating:
(1)
Published:
MQL5 Freelance Need a robot or indicator based on this code? Order it on Freelance Go to Freelance

An order block on Gold (XAUUSD) or any symbol is the last opposite candle before the move that breaks structure: the last bearish candle before a close above a confirmed swing high, or the last bullish candle before a close below a confirmed swing low. That candle becomes a zone, from high to low or body only.

The leg must show a real impulse, at least one candle with a body larger than a multiple of ATR, so slow drifts do not create zones. A fresh zone is coloured, a tested zone is dimmed after price comes back into it, and the zone is removed when a candle closes through it.

Swings are confirmed only after the bars on both sides have closed, so a zone appears a few bars after the move and does not repaint. A zone shows where the move started, not where price must turn. Test it on your symbol and timeframe before you trade it.

Order Blocks Zones SMC indicator drawing bullish and bearish order block zones on a XAUUSD chart in MetaTrader 5

Settings

  • Swing length: bars on each side that confirm a swing high or low. Default 5.
  • Impulse filter: the largest body in the leg must be at least this many ATR. Default 1.0. 0 turns it off.
  • ATR period: default 14.
  • Zone drawn from the candle: full candle (high to low) or body only.
  • Bars to scan: history used on load. Default 1500.
  • Show bullish / bearish, maximum live zones per side, keep broken zones and the four colours.
  • Alerts: new order block and first return of price to a fresh zone, by popup, push and sound.
  • Object prefix: change it to run two copies on one chart, for example two swing lengths.

What it needs

Any symbol, any timeframe, any broker. It only draws rectangles, it never trades.

Make it yours

Compare the zones on XAUUSD, EURUSD, GBPUSD, US30 and NAS100, on M15 and H1 for intraday and H4 for swing trading. A smaller swing length gives more zones, a larger one keeps only the main legs. Order blocks are a core piece of Smart Money Concepts, so they read well next to a BOS and CHoCH tool and a fair value gap tool. XP_CheckBreak finds the zone and XP_UpdateZones tracks it, both ready to reuse in an EA that waits for the first return to a fresh zone.

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-11-02 - Initial release
Broker Rollover Spread Logger and EA Guard Broker Rollover Spread Logger and EA Guard

Tracks live midnight rollover spread spikes against a self-calibrating daytime baseline and outputs a binary iCustom guard flag (Buffer 0) so EAs can pause entries during liquidity drains.

Risk and Stop-Loss Calculator Risk and Stop-Loss Calculator

When I first started scalping, I had a problem: during periods of high volatility, it sometimes took too long to calculate exactly 1%, and I’d end up setting an incorrect stop-loss or using a position size that was too low or too high. But with this calculator, I can do it much faster—I just have to drag a line to the stop-loss zone, and it automatically calculates the position size I should use for my 1%. I hope you find it very useful!

G7 Pro Trade Manager and Prop Firm Equity Protector Auto-BE Trailing Stop 1-Click HUD) G7 Pro Trade Manager and Prop Firm Equity Protector Auto-BE Trailing Stop 1-Click HUD)

G7 Pro Trade Manager & Prop Firm Equity Protector is a professional on-chart trading assistant for manual traders and prop firm accounts (FTMO, FundedNext, The5ers). It features a clean obsidian HUD dashboard directly on the MT5 chart with 1-click execution, automated breakeven shield, dynamic trailing stop, and a daily loss circuit breaker to protect your funded account. Compatible with all pairs and accounts.

MACD Signals MACD Signals

Indicator edition for new platform.