Gold Flash
- Experts
-
Shipra Gupta
I’m Shipra Gupta, a trader and quantitative strategy developer with a strong background in mathematics, economics, and algorithmic trading systems. Over the years, I’ve worked extensively across forex, gold, indices, commodities, and crypto markets, focusing on building data-driven trading - Version: 1.50
- Activations: 15
GoldFlash EA — Adaptive Gold Breakout Expert Advisor for MetaTrader 5
GoldFlash is a fully automated Expert Advisor engineered specifically for XAUUSD (Gold) trading on MetaTrader 5. It combines a classic Donchian Channel breakout entry with a dual-EMA trend filter, adaptive ATR-based volatility gating, and smart session filtering — all tuned through a rigorous data-driven analysis of 1,700+ real backtest trades over five years of Gold price data.
Strategy Overview
- Built around a proprietary H4 breakout model developed through the analysis of more than 1,700 historical XAUUSD trades.
- Uses a trend-confirmation framework to align entries with prevailing market direction rather than trading every breakout signal indiscriminately.
- Incorporates volatility-based market selection designed to participate during favorable trading conditions while filtering out lower-quality environments.
- Features adaptive stop management and risk controls that automatically adjust to changing market dynamics and Gold price levels.
- Employs an expectancy-focused trade management approach that prioritizes long-term consistency through disciplined risk control and profit protection.
Key Filters (Data-Driven)
ATR Volatility Filter — GoldFlash only trades when the market is in a trending/volatile regime. Specifically: SL_dist < H4_ATR(14) × 0.30 . If the SL represents more than 30% of recent average range, the market is too choppy for breakout trading and the order is skipped. This single filter improved win rate from 34% to 39% in backtesting.
NY Session Block — Analysis of 1,700+ trades revealed that H4 bars opening during GMT hours 12, 14, and 16 consistently underperformed due to NY session overlap noise and mid-session consolidation. Blocking these hours pushed win rate to 43% with average profit of 0.25R per trade versus 0.08R unfiltered.
Sunday Filter — Skips Sunday bars to avoid gap-related false breakouts at the weekly open.
Backtest Performance Summary (5-Year, XAUUSD H4)
- No filters: 1,745 trades | Win Rate 34% | Avg R/trade 0.08
- ATR filter only: 606 trades | Win Rate 39% | Avg R/trade 0.18
- ATR + NY session block (v1.20): 330 trades | Win Rate 43% | Avg R/trade 0.25
Tested on 5 years of XAUUSD M5 data, strategy logic runs on H4 signal.
How to Use
- Attach to any XAUUSD chart (any timeframe — the EA internally uses H4)
- Set your broker's GMT offset if needed to align the session filter correctly
- Set InpRiskPct = 2.0 for 2% risk per trade (recommended)
- Leave InpUseATRFilter = true and InpBlockNYSession = true (default on)
Parameter Reference & Optimization Guide
Core Strategy Parameters
- InpDC_Period (default: 10) — Donchian channel lookback in H4 bars. Optimize range 7–20. Shorter values generate more trades but add noise; 10 is the data-validated sweet spot.
- InpEMAFast (default: 3) — Fast EMA period on H4. Keep in the 2–5 range. Going above 5 introduces lag on the trend filter.
- InpEMASlow (default: 10) — Slow EMA period on H4. Optimize in the 8–15 range. Must be significantly larger than the fast EMA for the crossover to carry directional meaning.
- InpSL_Factor (default: 0.0017) — Scales SL distance to Gold's current price. Optimize range 0.0015–0.0022. Do not deviate widely as it directly affects the ATR ratio logic.
- InpTP_RR (default: 1.2353) — Take Profit as a multiple of SL distance. Optimize range 1.1–1.8. Higher values reduce win rate but increase per-trade profit; always backtest changes.
- InpTrailStep (default: 0.20) — Minimum price move before the trailing stop updates. Range 0.10–0.50. Smaller values trail tighter but risk premature exits on intrabar noise.
ATR Filter Parameters
- InpATR_Period (default: 14) — ATR lookback on H4. Standard setting; no need to change.
- InpATR_SL_Ratio (default: 0.30) — The key ATR threshold. Setting it lower (e.g. 0.25) raises win rate to ~44.8% but cuts trade frequency to ~183 trades over 5 years. Setting it higher (e.g. 0.35) increases trades but win rate drops back toward 40%. 0.30 offers the best balance of quality and frequency.
Session & Direction Filters
- InpBlockNYSession (default: true) — Blocks H4 bars at GMT hours 12, 14, and 16. Strongly recommended on — adds approximately +4% to win rate.
- InpBlockSunday (default: true) — Skips Sunday candles. Recommended on.
- InpLongOnly (default: false) — Optional long-only mode. Longs showed 36% win rate vs 31% for shorts in testing. Useful if you prefer directional bias aligned with the broader Gold bull trend.
Risk Parameters
- InpRiskPct (default: 2.0) — Percentage of account balance risked per trade. Recommended range 1–3%.
- InpMaxSpread (default: 50.0) — Maximum allowed spread in points. For most Gold ECN brokers, 20–50 is normal; anything above 80 suggests a requote environment and should be skipped.
Recommended Optimization Sequence
- Keep InpSL_Factor = 0.0017 fixed — this is derived from Gold's price structure, not a free variable.
- Optimize InpDC_Period first (range 7–20, step 1) with EMA defaults and all filters ON.
- Optimize InpATR_SL_Ratio (range 0.20–0.45, step 0.05) to find the win rate vs trade frequency tradeoff that fits your risk appetite.
- Optimize InpTP_RR last (range 1.0–2.0, step 0.1) since it interacts with the trailing stop behavior.
- Always run Walk-Forward Analysis over at least 3 years to avoid overfitting. Default parameters are validated on 5 years of data.
Requirements
- MetaTrader 5 (build 2361+)
- Symbol: XAUUSD
- Recommended broker: ECN/Raw spread account with Gold spreads under 30 points
- VPS recommended for uninterrupted session filter execution
Keywords
XAUUSD EA, Gold Expert Advisor, MQL5 Gold EA, Donchian Channel breakout, adaptive stop loss, ATR filter EA, session filter Expert Advisor, Gold scalper MQL5, automated gold trading, EMA crossover EA, trailing stop EA MetaTrader 5, best Gold EA MT5, profitable Gold robot, XAU USD algorithmic trading
