Watch SMC Structure EA
- Experts
-
Sinmiloluwa Daniel Ogunmola
MQL5 developer focused on EAs that survive real brokers, not just the tester. - Versione: 1.1
- Aggiornato: 31 ottobre 2026
- Attivazioni: 5
Rule-based smart money concepts EA: break of structure, order blocks, fair value gaps, fixed risk per trade, daily loss limit and news filter.
Many traders who use smart money concepts mark structure by hand and then hesitate, enter late, or keep trading after a bad morning. The setup is clear on the chart, but turning it into consistent entries, a fixed risk per trade and a firm stop for the day is where most manual trading breaks down. Most SMC tools only draw zones; they leave the entry, the sizing and the daily stop to you.
This Expert Advisor applies the same rules on every closed bar. It confirms swing highs and lows, detects a break of structure or change of character, and looks for an entry from a recent order block or fair value gap. A liquidity sweep can be required, or used as a flag only. An optional higher-timeframe EMA keeps entries in the direction of the larger trend.
Risk is checked before anything else:
- Lot size comes from a fixed percentage of the balance and the stop distance. If that lot is below the broker minimum, the EA uses the minimum lot only when free margin covers it and it is within the lot cap (InpMaxLot); otherwise the trade is skipped. On small accounts this means actual risk per trade can be above InpRiskPct.
- The stop is placed beyond the zone or swing, with an ATR fallback, and the target is a set multiple of the stop.
- Trading stops for the day when the daily loss limit is reached (closed and open results both count). An optional daily gain lock stops new entries after a set gain.
- Free margin, lot limits and the broker stops level are checked before every order.
- An optional spread limit (off by default), a trading-hours window, manual blackout windows and a high-impact USD news filter (MetaTrader economic calendar) block entries at risky times.
Zones and labels are drawn on the chart, and a small panel shows the last signal and the reason a signal was not taken.
The EA does not use DLLs, web requests or external services. It works on any symbol and timeframe; the recommendations below are suggestions, not limits.
Recommended symbols and timeframes:
- Designed for XAUUSD (gold, including broker suffix variants) with signals on M15 and bias on H1. The chart timeframe does not matter; the EA uses the InpTF and InpHTF inputs.
- Also usable on liquid FX majors such as EURUSD and GBPUSD with the same timeframes.
- Use a broker with low spreads. InpMaxSpreadPts is 0 (off) by default; set it per symbol if you want a spread filter (remember 3-digit gold quotes more points).
- Small deposits: if 0.5% risk is below the broker minimum lot, the EA trades the minimum lot when margin allows, so real risk per trade is higher. Use a deposit where 0.5% covers the minimum lot if you want the stated risk.
Inputs:
- Symbol: InpSymbol (default "") - symbol to trade ("" = chart symbol)
- Symbol: InpTF (M15) - timeframe for structure detection
- Symbol: InpHTF (H1) - higher timeframe for trend bias
- Symbol: InpHTFEma (200) - bias EMA period (0 = no bias filter)
- SMC Detection: InpSwingLen (3) - bars on each side to confirm a swing
- SMC Detection: InpLookback (300) - bars scanned for structure
- SMC Detection: InpUseFVG / InpUseOB (true / true) - detect fair value gaps / order blocks
- SMC Detection: InpUseSweep / InpRequireSweep (true / false) - flag liquidity sweeps / only trade after a sweep
- SMC Detection: InpZoneExpiryBars (100) - zones older than this are ignored
- SMC Detection: InpDraw (true) - draw zones and labels
- Stops & Targets: InpSLByStructure (true) - stop beyond zone or swing (false = ATR stop)
- Stops & Targets: InpATRPeriod / InpATRMultSL (14 / 1.5) - ATR period and ATR multiple for the stop (also minimum stop distance)
- Stops & Targets: InpRR (2.0) - target = stop distance x this
- Risk: InpAutoTrade (true) - trading on/off (false = signals only)
- Risk: InpRiskPct (0.5) - risk % of balance per trade
- Risk: InpMaxDailyLossPct (2.0) - stop trading for the day after this % loss
- Risk: InpDailyGainLockPct (15.0) - stop new entries after this daily gain % (0 = off)
- Risk: InpMaxOpen (1) - maximum open positions by this EA
- Risk: InpMaxSpreadPts (0) - maximum spread in points (0 = off, default)
- Risk: InpMaxLot (0) - maximum lot per trade (0 = broker maximum); also caps the min-lot fallback
- Risk: InpMagic / InpSlippage (20261013 / 30) - magic number / slippage in points
- Session: InpSessionFilter / InpSessStartHr / InpSessEndHr (true / 8 / 20) - trading window in server time
- News: InpNewsFilter (true) - block around high-impact USD events
- News: InpNewsBeforeMin / InpNewsAfterMin (30 / 30) - minutes blocked before / after an event
- News: InpManualBlackouts ("") - extra daily windows, server time "HH:MM-HH:MM;HH:MM-HH:MM"
Risk disclaimer: Trading leveraged products such as forex and CFDs carries a high level of risk and may not be suitable for all investors. You can lose more than your deposit. This EA does not guarantee profit, and past or backtested results do not indicate future results. The economic calendar filter is not available in the Strategy Tester, so backtests do not include it. Test on a demo account with your own broker's conditions before using real money, and only trade money you can afford to lose.
