Gold Leapfrog
- Experts
- Version: 1.10
- Updated: 7 August 2026
- Activations: 10
Gold Leapfrog is an institutional-grade, multi-asset trading system built specifically around Gold (XAUUSD) as the primary precious metal anchor, supported by four major Forex correlation pairs (EURUSD, GBPUSD, USDJPY, AUDUSD). The Expert Advisor combines multi-timeframe correlation analysis, Beta risk parity lot scaling, and an adaptive grid recovery engine to trade directional momentum while maintaining strict capital protection.
Every trade is automatically guarded by dynamic ATR-based Stop Loss and Take Profit orders calculated with tick-size precision. All execution and order-management routines have been hardened to operate smoothly across both Netting and Hedging account models, surviving adverse broker conditions such as spread widening, execution latency, low balances, and market-close session gaps. The EA passes MQL5 Market Validation cleanly with zero journal errors.
Key Capabilities
The EA monitors Gold and its four correlated Forex pairs from a single chart. Unlike simple single-symbol systems, Gold Leapfrog calculates rolling Pearson correlation and Beta parity against Gold on the hourly timeframe. When the Correlation Filter is enabled, the EA evaluates direction across the portfolio, executing trades only when statistical alignment confirms the bias. You can also disable the correlation filter to trade each symbol independently on any chart timeframe you choose.
Trades are managed by a dual-mode dynamic grid. The "Grid in Profit" mode scales into winning positions to capture extended trends, while the "Grid in Loss" mode manages floating drawdown using a Smart Lot Multiplier. Rather than doubling lot sizes blindly, the multiplier scales geometrically and integrates broker max-volume limits and margin checks to prevent account over-leveraging.
An Algorithmic Rescue Mode allows the EA to adopt floating manual trades (Magic 0) or orders left behind by broken third-party EAs. Once adopted, Gold Leapfrog applies its mathematical recovery engine and trailing basket logic to manage those floating positions out of drawdown.
The built-in Broker Defense Suite protects against execution spikes and stop-hunting. It includes optional Virtual Stop Loss and Take Profit levels hidden from the broker server, High Margin Requirement (HMR) trap detection during leverage drops, and real-time execution latency monitoring.
An institutional Drawdown Circuit Breaker monitors account equity in real time. If equity drawdown reaches your specified threshold—or if daily loss/profit limits are hit—the EA closes open positions safely in chunks and locks out trading to protect your capital. The Trailing Basket profit-locker continuously tracks cumulative dollar profit across all positions, trailing the peak and closing the entire basket once a retracement step is reached.
The interactive on-chart dashboard and control panel provide one-click Buy and Sell execution, selective closing buttons (close profit, close loss, close all by pair, close all orders), and toggles for Auto Trading, Grid Modes, Mobile Mirroring, and Night Unload. The dashboard displays real-time account equity, free margin, today's profit, weekly profit, monthly profit, and per-symbol breakdowns, overlaid with visual 64-EMA Rainbow and Smoothed Heikin-Ashi chart indicators.
Internal Hardening and Validation Compliance
The codebase is engineered to meet standard market quality requirements:
- All Stop Loss and Take Profit distances are normalized to broker tick size, stop levels, and freeze levels.
- Orders execute via a two-stage market execution model to prevent order-splitting errors on STP and ECN brokers.
- Pre-trade free margin simulations ensure the EA never attempts trades that exceed available margin, preventing no-money rejection errors.
- Netting account positions close in calculated chunks bounded by symbol volume maximums and directional limits.
- Built-in session validation ensures the EA never attempts order operations while a symbol's trading session is closed.
- Zero calls to testing abort functions ensure uninterrupted evaluations during automated backtests.
Input Parameters
General
- InpLanguage – Interface language (English or Russian)
- InpNaturalLanguagePreset – Presets for conservative, balanced, or aggressive scaling
Risk and Lot Management
- InpStopLossPercent – Stop Loss as a percentage of balance (0 = Disabled)
- InpUseLotManual – Enable manual fixed lot sizing
- InpManualLot – Fixed manual lot size
- InpRisk – Risk percentage per trade for automatic lot sizing
- InpProfitPips – Profit target in pips for take profit
- InpMinPips – Minimum candlestick size in pips for entry signals
- InpTimeFrame – Candlestick timeframe for entry signals
- InpUseLotIncrease – Enable smart lot multiplier for grid scaling
- InpGridMultiplier – Lot multiplier for sequential grid levels
Trading Symbols and Grid Steps
- InpSymbolXAUUSD – Gold vs US Dollar symbol name
- InpStepXAUUSD – Grid step in pips for XAUUSD
- InpSymbolSym2 to Sym5 – Custom Forex correlation symbols (EURUSD, GBPUSD, USDJPY, AUDUSD)
- InpStepSym2 to Sym5 – Grid steps in pips for secondary symbols
- InpMaxOrders – Maximum total open orders allowed across the portfolio
- InpMobileClosePair – Symbol used to trigger a remote close-all from mobile
Trading Hours
- InpTimeStart – Trading start hour (broker server time)
- InpTimeEnd – Trading end hour (broker server time)
EA Configuration
- InpSpeedEA – EA timer interval in milliseconds
- InpMagicNumber – Unique identifier for EA orders
Advanced Filters (ATR, RSI, EMA, AI)
- InpUseATRStep – Enable dynamic grid step sizing based on ATR
- InpATRPeriod – ATR calculation period
- InpATRTimeFrame – ATR timeframe
- InpUseRSIFilter – Enable hourly RSI exhaustion filter
- InpRSIPeriod – RSI calculation period
- InpRSIOverbought – RSI overbought ceiling for buy signals
- InpRSIOversold – RSI oversold floor for sell signals
- InpUseEMAFilter – Enable H4 EMA trend filter
- InpEMAPeriod – EMA period
- InpEMATimeFrame – EMA timeframe
- InpUseEMARainbow – Display 64-EMA Rainbow chart overlay
- InpUseSmoothedHA – Display Smoothed Heikin-Ashi chart overlay
- InpShowCandleCountdown – Display live bar countdown timer
- InpUseAIEngine – Enable adaptive parameter adjustment
Correlation Engine
- InpUseCorrelationFilter – Enable Gold correlation filter (false = trade independently)
- InpForceTradeAnySymbol – Allow independent symbol entries
- InpCorrelationTimeFrame – Timeframe for Pearson correlation calculation
- InpCorrelationPeriod – Bars for rolling correlation
- InpCorrelationThreshold – Minimum absolute correlation threshold
- InpUseBetaScaling – Enable Beta risk-parity lot scaling relative to Gold
- InpBetaMinMultiplier – Minimum allowed Beta lot multiplier
- InpBetaMaxMultiplier – Maximum allowed Beta lot multiplier
Broker Defenses and Anti-Manipulation
- InpUseBrokerDefenses – Enable broker defense suite
- InpUseVirtualStops – Use hidden virtual Stop Loss and Take Profit
- InpUseHMRDetection – Enable High Margin Requirement trap detection
- InpHMRMarginMultiplier – Maximum allowed initial margin spike ratio
- InpMaxExecutionLatencyMs – Latency warning threshold in milliseconds
- InpMaxLatencyWarnings – Consecutive latency warnings before temporary cooldown
Algorithmic Rescue Mode
- InpUseRescueMode – Enable floating trade rescue mode
- InpRescueManualOnly – Rescue only manual trades and EA trades
- InpRescueTargetMagic – Specific Magic Number to rescue (0 = All non-EA trades)
- InpRescueAllSymbols – Adopt floating trades across all account symbols
Institutional Risk and Margin Protections
- InpMaxDrawdownPercent – Maximum allowed equity drawdown percentage
- InpHWMDrawdownPercent – High-water mark equity drawdown limit percentage
- InpDailyLossPercent – Daily equity loss ceiling percentage
- InpDailyProfitPercent – Daily equity profit-lock target percentage
- InpSymbolMaxDDPercent – Per-symbol drawdown limit percentage
- InpSymbolMaxDDClosePercent – Per-symbol emergency close drawdown percentage
- InpMinMarginLevelPercent – Minimum margin level percentage required for new trades
- InpCriticalMarginLevelPercent – Critical margin level percentage for stop-out protection
- InpMinFreeMarginPercent – Minimum free margin buffer percentage
- InpUseDynamicLotScaling – Scale down lot sizes when margin level drops below 300 percent
- InpUseTrailingBasket – Enable trailing stop on cumulative basket profit
- InpBasketTriggerDeposit – Basket dollar profit activation threshold
- InpBasketTrailingStep – Basket dollar trailing step
Support For technical questions, feedback, or assistance, please use the MQL5 product comments section or built-in MQL5 messaging.
