XAUUSD 10-Minute Strategy

Key Components and Logic:
MACD (12, 26, 9):
- Generates buy signals on MACD Line crossovers above the Signal Line and sell signals on crossovers below the Signal Line, helping to capture momentum shifts.
RSI (14):
- Utilizes oversold (below 35) and overbought (above 65) levels as a secondary filter to validate entries and avoid overextended price zones.
Bollinger Bands (20, 2):
- Uses upper and lower Bollinger Bands to identify potential overbought and oversold conditions, aiming to enter long trades near the lower band and short trades near the upper band.
ATR-Based Stop Loss and Take Profit:
- Stop Loss and Take Profit levels are dynamically set as multiples of ATR (3x for stop loss, 5x for take profit), ensuring flexibility with market volatility to optimise exit points.
Entry & Exit Conditions:
Buy Entry: Triggered when any of the following conditions are met:
- MACD Line crosses above the Signal Line
- RSI is oversold
- Price drops below the lower Bollinger Band
Sell Entry: Triggered when any of the following conditions are met:
- MACD Line crosses below the Signal Line
- RSI is overbought
- Price moves above the upper Bollinger Band
Exit Strategy: Trades are closed based on opposing entry signals, with adaptive spread adjustments for realistic exit points.
Backtesting Configuration & Results:
- Backtesting Period: July 21, 2024, to October 30, 2024
- Symbol Info: XAUUSD, 10-minute timeframe, OANDA data source
- Backtesting Capital: Initial capital of $700, with each trade set to 10 contracts (equivalent to approximately 0.1 lots based on the broker’s contract size for gold).
Users should confirm their broker's contract size for gold, as this may differ. This script uses 10 contracts for backtesting purposes, aligned with 0.1 lots on brokers offering a 100-contract specification.
Key Backtesting Performance Metrics:
- Net Profit: $4,733.90 USD (676.27% increase)
- Total Closed Trades: 526
- Win Rate: 53.99%
- Profit Factor: 1.44 (1.96 for Long trades, 1.14 for Short trades)
- Max Drawdown: $819.75 USD (56.33% of equity)
- Sharpe Ratio: 1.726
- Average Trade: $9.00 USD (0.04% of equity per trade)
This backtest reflects realistic conditions, with a spread adjustment of 38 points and no slippage or commission applied. The settings aim to simulate typical retail trading conditions. However, please adjust the initial capital, contract size, and other settings based on your account specifics for best results.
Usage:
This strategy is tuned specifically for XAUUSD on a 10-minute timeframe, ideal for both trend-following and reversal trades. The ATR-based stop loss and take profit levels adapt dynamically to market volatility, optimising entries and exits in varied conditions. To backtest this script accurately, ensure your broker’s contract specifications for gold align with the parameters used in this strategy.
Skrip sumber terbuka
Dalam semangat sebenar TradingView, pencipta skrip ini telah menjadikannya sumber terbuka supaya pedagang dapat menilai dan mengesahkan kefungsiannya. Terima kasih kepada penulis! Walaupun anda boleh menggunakannya secara percuma, ingat bahawa menerbitkan semula kod ini adalah tertakluk kepada Peraturan Dalaman kami.
Untuk akses pantas pada carta, tambah skrip ini kepada kegemaran anda — ketahui lebih lanjut di sini.
Penafian
Skrip sumber terbuka
Dalam semangat sebenar TradingView, pencipta skrip ini telah menjadikannya sumber terbuka supaya pedagang dapat menilai dan mengesahkan kefungsiannya. Terima kasih kepada penulis! Walaupun anda boleh menggunakannya secara percuma, ingat bahawa menerbitkan semula kod ini adalah tertakluk kepada Peraturan Dalaman kami.
Untuk akses pantas pada carta, tambah skrip ini kepada kegemaran anda — ketahui lebih lanjut di sini.