MASTER_WINNERFX_GOLD_MT5
This EA is a grid trading system for gold (XAUUSD) that uses EMA trend direction and RSI momentum for initial entries, then adds up to 3 martingale-scaled grid positions at fixed pip intervals when price moves against the trade. All positions are closed when combined profit reaches a target or loss exceeds a maximum risk threshold.
Open the interactive view (equity curve, symbol switch)Key facts
Backtest results (H1, about 1 year)
| Symbol | P&L | Annual | Max DD | Trades | Win rate | Sharpe | Recovery | Losing streak | Per trade | Status |
|---|---|---|---|---|---|---|---|---|---|---|
| EURUSD | -2.96% | -2.57% | 6.09% | 112 | 41.40% | -0.60 | -0.49 | 10 | −$2.97 | Reliable |
| GBPUSD | -2.03% | -1.76% | 9.27% | 112 | 45.00% | -0.28 | -0.22 | 8 | −$2.09 | Reliable |
| USDJPY | -6.09% | -5.32% | 9.37% | 160 | 42.80% | -1.19 | -0.65 | 5 | −$3.80 | Reliable |
| XAUUSD | +46.15% | +36.83% | 64.45% | 101 | 39.60% | 0.90 | 0.72 | 14 | +$45.70 | Reliable |
Profitable on 1 of 4 markets with reliable results.
Converted from MQL5 to Python and run with the same rules for every EA. Positions use MT5 lot sizes (100,000 units per FX lot, 100 oz per gold lot) with 1:100 leverage, one order at a time, and a stop-out below 10% of the starting balance. Sharpe is computed from the equity curve. Results marked as unreliable are shown for completeness only.
Month by month
| Market | Months with a gain | Best month | Worst month |
|---|---|---|---|
| EURUSD | 46% | +1.74% 2026-03 | -3.58% 2026-04 |
| GBPUSD | 46% | +1.66% 2026-10 | -3.89% 2026-04 |
| USDJPY | 31% | +1.04% 2025-11 | -2.40% 2026-03 |
| XAUUSD | 69% | +58.33% 2026-01 | -23.23% 2026-07 |
From the backtest equity curve, sampled about every two days; only reliable results.
Blow-up risk: High
- Opens a grid of orders at fixed price steps
- Has no stop loss or trailing stop
- Can hold up to 6 positions at once
High: stopped out in our backtest, or martingale/grid sizing without a stop loss. Elevated: martingale or grid sizing with a stop loss, or several positions at once without a stop loss. What the label means and what we found →
Strategy analysis
The strategy concept is a trend-following grid pyramiding system that combines EMA for trend direction and RSI for momentum confirmation before initial entry. Entry conditions are: go long when price is above EMA and RSI is above 55, or go short when price is below EMA and RSI is below 45. Exit conditions are twofold: close all positions when total combined profit reaches TargetProfit, or close all when total loss exceeds MaxRisk. Position sizing uses dynamic lots calculated from account balance at LotPer1000 per $1000, and grid additions use a Multiplier factor to increase lot size progressively, making this a martingale-style pyramiding approach. Money management checks free margin via CanOpenTrade before each order and normalizes lot size via GetSafeLot, but the maximum grid level is hard-coded to 3 layers. Grid spacing is fixed at GridStep points, and no individual stop-loss or take-profit price levels are set on any order, relying entirely on combined P&L triggers for exits.
Strengths
- Uses dual EMA and RSI filters for initial entry direction, avoiding counter-trend openings
- Dynamic lot sizing automatically adjusts based on account balance, providing proportional risk management
- MaxRisk parameter caps maximum allowed loss, preventing total account blowout
- Pauses trading during news hours and market close hour, avoiding high-volatility periods
- Uses MagicNumber to tag positions, preventing conflicts with other EAs
Weaknesses
- Grid pyramiding uses a 1.2x martingale multiplier, causing increasingly large positions against the trend which amplifies losses exponentially
- No individual stop-loss prices are set on any order, relying entirely on programmatic closing via OnTick which fails if the terminal disconnects
- RSI thresholds are counterintuitive with buy threshold at 55 and sell threshold at 45, the narrow gap may cause frequent misjudgment of direction
- Maximum grid layers are hard-coded to 3 with no parameter to adjust, limiting flexibility
- News pause is based only on a fixed hour, unable to adapt to different economic calendars or actual news release times
- No new bar check is implemented, every tick triggers evaluation which could lead to redundant or rapid-fire order attempts
Possible improvements
- Add new bar detection logic to prevent repeated entries and grid additions within the same candle
- Set stop-loss price levels on each individual order to protect against terminal disconnection scenarios where programmatic closing cannot execute
- Make maximum grid layers a configurable parameter and add a total exposure lot size cap check
- Add spread filtering to avoid opening positions during high-spread conditions, especially before/after news and during low-liquidity sessions
Risk assessment
Overall risk: High risk
- Martingale-style grid pyramiding rapidly amplifies losses in adverse markets, with 3 layers at 1.2x multiplier reaching 1.728x base lot on the final layer
- No stop-loss prices on any order means if the MT5 terminal disconnects from the server, programmatic closing logic cannot execute, leaving positions fully exposed to unlimited market risk
- No new bar check mechanism could cause rapid-fire repeated entry triggers within extremely short timeframes
- MaxRisk is set as a fixed dollar value rather than a percentage, causing the risk proportion to vary as the account grows or shrinks
Evaluation scores
Parameters
| Parameter | Default | Description |
|---|---|---|
LotPer1000 | 0.01 | Base lot size per $1000 balance |
Multiplier | 1.2 | Grid lot multiplier (Martingale factor) |
GridStep | 1500 | Grid spacing in points |
TargetProfit | 3.0 | Portfolio profit target in USD, close all on reach |
MaxRisk | 1000.0 | Max allowed loss in USD, close all on breach |
MagicNumber | 506780 | EA magic number for identifying its positions |
EMAPeriod | 50 | EMA period for trend direction |
TrendTF | PERIOD_M15 | Timeframe used for trend determination |
RSIPeriod | 14 | RSI period |
RSILower | 55 | RSI long threshold (above confirms bullish momentum) |
RSIUpper | 45 | RSI short threshold (below confirms bearish momentum) |
PauseDuringNews | true | Pause trading during news events |
NewsHoursUTC | 13 | News event hour in UTC |
MarketCloseHour | 22 | Market closed hour, no trading during this hour |
Similar Grid EAs
Backtests are historical simulations and do not guarantee future results. Not financial advice.