EMA 200 + RSI(14) Pullback Backtest on Gold (XAU/USD, 4H)
Combining a 200-EMA macro trend filter with RSI(14) 35/65 pullback triggers and ATR-scaled stops on OANDA:XAUUSD from 2020 to 2026.
TradingView Live Backtest Report: OANDA:XAUUSD (4H)
| Segment | Trades | Win Rate | Profit Factor | Avg Win / Loss | Net Profit | Max Drawdown |
|---|---|---|---|---|---|---|
| All Trades | 81 (34W / 47L) | 41.98% | 1.33 | 1.84 ($204.44 / $111.04) | +$1,731.69 (+1.73%) | $1,800.63 (1.77%) |
| Long Only | 47 (20W / 27L) | 42.55% | 1.41 | 1.90 ($230.42 / $121.02) | +$1,340.95 (+1.34%) | — |
| Short Only | 34 (14W / 20L) | 41.18% | 1.20 | 1.71 ($167.32 / $97.58) | +$390.74 (+0.39%) | — |
4 Quantitative Takeaways for Gold Prop Traders
- Selective Frequency Preserves Prop Rules: Only 81 trades across 6+ years (about 1 trade/month on 4H) kept maximum drawdown at just 1.77%—comfortably inside 5% daily and 10% overall caps.
- Positive Edge on Both Sides: Longs generated 1.41 PF and shorts maintained 1.20 PF, confirming structural symmetry of trend-filtered pullbacks on Gold.
- Win Rate Beats Breakeven by +6.8%: With an avg win/loss of 1.84, breakeven is 35.2% while realized win rate reached 41.98%.
- Note on Gold vs Buy & Hold: Over 2020–2026 Gold surged +126.26% spot; active pullback trading sacrifices raw upside in exchange for low 1.77% drawdown suited to prop rules.
Reproducible TradingView Pine Script v5 Code
//@version=5
strategy("TradeMathLab RSI Pullback Gold", overlay=true, initial_capital=100000, default_qty_type=strategy.percent_of_equity, default_qty_value=10, commission_type=strategy.commission.percent, commission_value=0.02)
ema200 = ta.ema(close, 200)
rsi14 = ta.rsi(close, 14)
atr = ta.atr(14)
if close > ema200 and ta.crossover(rsi14, 35) and strategy.position_size == 0
strategy.entry("Long", strategy.long)
strategy.exit("XL", "Long", stop=close - 1.5 * atr, limit=close + 2.5 * atr)
if close < ema200 and ta.crossunder(rsi14, 65) and strategy.position_size == 0
strategy.entry("Short", strategy.short)
strategy.exit("XS", "Short", stop=close + 1.5 * atr, limit=close - 2.5 * atr)
FAQ: XAU/USD RSI Pullback Backtest
Why did the EMA 200 filter lift performance compared to plain crossovers?
Requiring price above EMA 200 for longs and below EMA 200 for shorts prevents fading strong secular Gold trends while entering pullbacks at favorable ATR risk.
Why is total net profit +1.73% across 6 years in this test?
The script intentionally used conservative 10% position sizing (~$111 avg loss = 0.11% equity risk). Scaling risk to 0.5% per trade scales both net return and drawdown proportionally (~5x) while staying under a 10% prop limit.
Does 41.98% win rate pass a 2-step prop challenge with 0.5% risk?
At 42% win rate and 1.84 R:R, expectancy is +0.19R per trade; however, with only ~12–14 trades/year on 4H Gold, traders would combine multiple uncorrelated pairs to reach challenge targets faster.
What commission setting was used on OANDA:XAUUSD?
The backtest modeled 0.02% per side ($326.87 total commission paid across 81 round-trip trades).
Calculate Exact Gold XAU/USD Lot Sizes
Translate ATR stop distance into exact FTMO or FundedNext lots without guessing pip values.
Partner disclosure: links routed through /go/ may earn TradeMathLab a commission at no extra cost to you. Formulas and backtests remain independent.
Other Strategy Backtests
203 trades (2020–2026) proving why unguarded EMA crossovers bleed money in range-bound forex sessions.
372 trades (2022–2026) beating Buy & Hold (+34.08%), with $3,235.51 in Bybit-level Taker fees analyzed.