Gold EA Breakthrough: Our Final System's New XAUUSD Strategy!

Rejected methods · 7 min

## What's the idea?

A beginner-friendly summary of the verification: “Gold EA Breakthrough: Our Final System’s New XAUUSD Strategy!”.

Breakout entry example (XAUUSD daily, real data): buy when price breaks above the recent high.

Breakout entry example (XAUUSD daily, real data): buy when price breaks above the recent high.

What’s the idea?

We’ve been working on our flagship algorithmic trading system, which we call final_system. It’s designed to trade multiple assets, specifically Gold (XAUUSD) and four other major FX pairs. Our goal is always to make it more robust, profitable, and safer. This time, we focused on Gold. Previously, Gold was using a Breakout long strategy – essentially, buying when prices broke above a certain level, hoping for a trend to continue. We had a hunch that a different strategy, ATRcandle long, might perform better for Gold. The ATRcandle long strategy likely uses the Average True Range (ATR) to gauge volatility and identify entries based on candle characteristics, aiming to catch strong moves. The plan was simple: swap out the Breakout long for ATRcandle long only for Gold, while keeping the other four FX pairs on their existing Breakout long strategy. We then re-evaluated the entire system with a consistent risk setting of 0.003 (meaning a very small percentage of our capital risked per trade).

How I tested it

To see if this change was an improvement, we ran extensive backtests on the entire final_system. We looked at a range of performance metrics:

  • Total Return: How much profit the system generated overall.
  • Monthly Return: The average profit per month.
  • Maximum Drawdown (maxDD): The largest peak-to-trough decline in our account equity. A lower number means a smoother, less stressful ride.
  • Profit Factor (PF): Gross profit divided by gross loss. A PF greater than 1 means the system is profitable. Higher is better!
  • Sharpe Ratio: A measure of risk-adjusted return. It tells us how much return we’re getting for each unit of risk we’re taking. Again, higher is better.
  • Winning Years: How many years out of the backtest period showed a profit.
  • Monte Carlo (MC) Pass Rate: This is a crucial robustness test. We run many simulations, slightly varying parameters each time, to see how consistently the system remains profitable and stable. A higher pass rate means the system isn’t just lucky; it’s robust.
  • Intraday Safety: We also checked for any extreme intra-day drawdowns on the 1-minute chart (M1) to ensure the system wouldn’t have sudden, catastrophic losses during the trading day.

What happened?

The results were fantastic! The switch to ATRcandle long for Gold delivered significant improvements across the board for the entire final_system:

  • Total Return: Jumped from +49.7% to a solid +66.8%. That’s a huge boost in overall profitability!
  • Monthly Return: Increased from 0.30% to 0.38%. While it might seem small, consistent monthly gains add up.
  • Maximum Drawdown (maxDD): Improved from -7.9% to -7.1%. In other words, the system became less volatile, offering a smoother equity curve and less stress during losing periods.
  • Profit Factor (PF): Edged up from 1.28 to 1.29. A small but positive step.
  • Sharpe Ratio: Rose from 0.21 to 0.25, indicating better returns for the risk taken.
  • Winning Years: Remained consistent at 9-11 years, showing the system’s long-term stability wasn’t compromised. But the real showstopper was the Monte Carlo Pass Rate:
  • STEP1 Pass Rate: Went from 77% to 86%.
  • Overall Pass Rate: Soared from 66% to 78% – that’s a massive +12.7 percentage point increase! This tells us the system is much more robust and less sensitive to small parameter changes.
  • Max Loss Disqualification Rate: Dropped from 1.0% to 0.6%, meaning there’s even less chance of the system suffering a disqualifying, catastrophic loss in varied market conditions. Our intraday safety checks also confirmed that the system remained secure, with a worst-case intra-day drawdown of 4.06% and zero disqualifications. This was a clear win! The ATRcandle long strategy for Gold is now the new, official component of our final_system.

A minor technical note

We did observe a minor “minimum holding time violation” during backtesting for the ATRcandle strategy on Gold. This happens because its initial Stop Loss (SL) is quite tight, sometimes leading to trades closing on the very same bar they opened. However, this is an artifact of how backtesting software handles bar resolution. In live trading, we enforce a 15-second minimum hold, which resolves this issue completely and doesn’t impact the overall performance or robustness. Think of it as a speed bump in the simulation, not a pothole in the road!

Remaining considerations

While this change was overwhelmingly positive, it’s important to be realistic. The system’s performance is still partly influenced by specific market conditions, such as the strong Gold rally seen in 2024-25. It also retains some “regime dependence” on broader market trends like Yen depreciation and Gold strength. This means it performs best under certain conditions. Also, the overall monthly return still has a practical ceiling around 2%. We’re always striving for more, but consistency and safety are paramount.

What I learned

Beyond the main success, we also conducted two further experiments that taught us valuable lessons:

Experiment 1: Adding a Multi-Timeframe (MTF) filter to Gold

We explored adding an MTF filter to the ATRcandle strategy for Gold. This filter would use a higher timeframe (D1 Simple Moving Average) to ensure trades were only taken in alignment with the broader daily trend.

  • Initial Hopes: For Gold alone on the H1 timeframe, this MTF filter was incredibly effective! It almost halved the drawdown, from -18.5% to -9.3%. It seemed like a fantastic improvement, and it was robust across various settings.
  • The System’s Reality: However, when we integrated this filtered Gold strategy into the full final_system, it actually made things worse! The total return dropped from 66.8% to 61.2%, the system’s overall drawdown slightly increased from -7.1% to -7.3%, and the Monte Carlo pass rate fell from 78.4% to 74.5%.
  • The Big Lesson: Why did a seemingly great improvement for Gold alone hurt the overall system? The system’s drawdown (at -7%) isn’t primarily driven by Gold’s individual drawdown. Instead, it’s caused by multiple assets in the portfolio experiencing simultaneous, correlated drawdowns. Reducing Gold’s individual drawdown didn’t fix this system-level problem; it just cut into Gold’s profits without meaningfully improving the system’s overall risk.
  • Takeaway: Improving a component (like Gold’s strategy) is only beneficial if that component’s weakness is the bottleneck for the entire system’s performance. If it’s not, you might just be sacrificing returns for an improvement that doesn’t move the needle where it counts. So, we decided not to adopt the MTF filter for the final_system. This filter might still be useful for standalone Gold trading in the future, but not for our multi-asset system.

Experiment 2: Applying ATRcandle to Yen Crosses

Since ATRcandle worked so well for Gold, we wondered if it could also improve our strategies for Yen crosses (USDJPY, GBPJPY, EURJPY, CHFJPY).

  • Disappointing Results: For three out of the four Yen cross pairs (GBPJPY, EURJPY, CHFJPY), the original Breakout long strategy was clearly superior. The ATRcandle strategy led to significantly worse drawdowns for these FX pairs, ranging from -18% to a staggering -48% on the H1 timeframe for CHFJPY!
  • USDJPY’s Nuance: USDJPY was a bit of a mixed bag; its returns and drawdowns were somewhat competitive with the Breakout long. However, when integrated into the full system, it either made no difference or slightly worsened the overall performance.
  • The Conclusion: The ATRcandle strategy is clearly best suited for Gold. Gold often behaves as a “momentum” or “trend” market, where the ATRcandle can thrive. Yen crosses, on the other hand, tend to be more “ranging” and prone to false breakouts when volatility expands, making them less suitable for this particular strategy. This insight aligns with our historical research.
  • Takeaway: Strategies are not one-size-fits-all. What works brilliantly for one asset might be disastrous for another due to their fundamental market characteristics. The Yen crosses will stick with their proven Breakout long strategy.

This research reinforced a critical principle: continuous verification and targeted improvements are key. Sometimes, a small change can have a big impact, and sometimes, a seemingly good idea for one part of the system doesn’t translate to overall improvement. We’ll keep sharing our findings as we continue to refine and verify our algorithmic trading systems!

Code to reproduce

You can reproduce this with the following scripts (see repo).

  • strategies/atr_candle_breakout.py