Preview
In this post we introduce an Expert Advisor (EA) specifically designed for automated trading on XAUUSD (Gold). This EA operates without the use of indicators, relying solely on volatility and key OHLC values. Trade entries are exclusively in the long direction and occur at the beginning of the trading day, provided the necessary conditions are met. The strategy is executed on hourly (H1) time frames.
To ensure disciplined risk management every position is protected by predefined stop-loss and take-profit levels. The performance results available on our YouTube channel are based on a deliberately non-optimized system to prevent overfitting and provide a realistic assessment of the EA’s capabilities. However, key money management variables such as lot size, take profit, stop loss and other parameters can be adjusted upon request to better align with individual trading preferences and risk tolerance.
The development, testing and analysis of this EA were conducted under the following parameters:
- Starting capital: 1,000€
- Fixed lot size: 0,01
- Position types: Long-only
- Martingale or Hedging: No
- Leverage: 100
- Maximum open lots: 1
This post provides a detailed overview of the EA’s features, along with key performance metrics derived from rigorous testing. These insights offer traders a clear understanding of the algorithm’s behavior across different market conditions, enabling them to make informed decisions about its integration into their trading strategies.
The final section of this post displays the current status of the trading system, which may change if the system is disabled or replaced. Subscribers can download the EA executable file for free, ready for seamless integration into the MT4 platform, as long as the system remains active.
Development and Logic Description
To ensure the reliability and robustness of this Expert Advisor (EA), rigorous Out-of-Sample (OOS) testing was conducted. OOS testing is a crucial methodology in trading strategy evaluation, as it relies on historical data that was not used during the EA’s development phase. This approach helps mitigate the risk of overfitting to specific market conditions, providing a more objective assessment of the EA’s adaptability in real-world trading environments.
The validation process spanned eight months and utilized historical market data from two different brokers. This multi-broker approach is essential, as each broker operates under distinct trading conditions. By testing across different combinations of spreads and swaps, we ensured a more comprehensive and realistic evaluation of the EA’s performance.
Additionally, further tests were conducted by artificially shifting trade entries and exits. This step was crucial to verify that the strategy does not overly rely on past data patterns, reinforcing its robustness and generalizability in live market conditions.
The following values were considered:
- Spread: 44 points
- Swap (Long): -50.4 points
- Swap (Short): 23.6 points
The EA follows a long-only trading approach, a decision based on gold’s historical role as a safe-haven asset. Unlike some trading systems that incorporate high-risk strategies such as hedging (opening counteracting positions) or martingale (increasing position size after losses), this EA adheres to a fixed lot size of 0.01 and employs a straightforward, sustainable trading logic.
The EA executes trade entries at the beginning of each trading day to capitalize on gold’s strong price movements. This approach results in a high number of trades, relying solely on the instrument’s volatility rather than traditional indicators. The strategy is designed with a robust money management system that mitigates potential losses in the event of consecutive losing trades, ensuring long-term stability and controlled risk exposure.
Every trade executed by the EA follows a precise risk management framework, ensuring disciplined exit strategies:
- Stop Loss: 664 points
- Take Profit: 2858 points
- Break Even: 601 points
- Trailing Stop: Adjusted at 2718 points
By enforcing these exit parameters, the EA seeks to optimize returns while limiting downside risk. The strategy is designed to perform particularly well in strong bullish phases, aligning with gold’s long-term price trends as a safe-haven asset.
Trading System Statistics
The backtest results confirm a high level of data quality, with no errors or ambiguous bars detected throughout the process. A key observation is the consistency of the equilibrium line, which maintains a steady upward trajectory across all test scenarios. This indicates that variations in factors such as spreads, swaps and price quotes do not compromise the stability of the Expert Advisor.
The most significant performance metrics of the EA are summarized below:
- Sharpe Ratio: 0,29
- Profit Factor: 2,50
- Annualized Profit: 85,06%
- Maximum Drawdown: 5,08%
- Maximum Stagnation: 24 days
- Average Profit per Trade: 22,45€
- Average Loss per Trade: -10,65€
- Win/Loss Ratio: 0.54
Testing expert advisors firsthand is not only essential to verify their stability and functionality but also serves as a valuable exercise in understanding the disciplined approach and thorough methodology required to become a successful systematic trader.
The expert advisor can be downloaded directly from here: XAUUSD14032025.ex4
Status: Active
Best regards,
TradingQuant