Watch Gold SMC EA
- Experts
-
Sinmiloluwa Daniel Ogunmola
MQL5 developer focused on EAs that survive real brokers, not just the tester. - Versão: 1.1
- Atualizado: 31 outubro 2026
- Ativações: 5
Gold-focused smart money concepts EA: break of structure, order blocks, fair value gaps, liquidity sweeps, fixed risk, daily loss limit, USD news filter.
Gold moves fast around the London and New York sessions and around US news. Traders who read smart money structure on XAUUSD often see the setup but enter late, size inconsistently, or trade straight into a high-impact USD release.
This Expert Advisor applies the same rules on every closed bar of the signal timeframe. 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.
- Before every order the broker stops level, freeze level and current spread are checked; stops are widened to the minimum distance or the trade is skipped. Prices are rounded to the symbol tick size and margin is checked for the exact order type.
- Trading stops for the day when the daily loss limit is reached (closed and open results both count).
- A volatility filter skips signals when the current ATR is well below its recent average, so the EA stays out of dead gold sessions.
- Once price has moved a set multiple of the risk, the stop is moved to entry plus one tick (only ever tightened).
- 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, open trades, the day's result against the limit, and the reason a signal was not taken.
The EA does not use DLLs, web requests or external services. It is tuned for gold but runs on any symbol.
Recommended symbols and timeframes:
- XAUUSD (gold, including broker suffix variants such as XAUUSDm, GOLD, XAUUSD.r) with signals on M15 and bias on H1. The chart timeframe does not matter; the EA uses the InpTF and InpHTF inputs.
- Other symbols work too (for example EURUSD), but the defaults were chosen with gold in mind.
- Use a broker with low gold spreads. InpMaxSpreadPts is 0 (off) by default; if you set it, remember 2- or 3-digit gold quotes count more points.
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 and Targets: InpSLByStructure (true) - stop beyond zone or swing (false = ATR stop)
- Stops and Targets: InpATRPeriod / InpATRMultSL (14 / 1.5) - ATR period and ATR multiple for the stop (also minimum stop distance)
- Stops and 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 (20261014 / 30) - magic number / slippage in points
- Gold filters: InpVolLookback / InpMinATRRatio (100 / 0.7) - trade only when ATR is at least this multiple of its average over the lookback (0 = off)
- Gold filters: InpBreakEvenR (1.0) - move the stop to entry + 1 tick at this multiple of risk (0 = off)
- 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 gold, 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.
