RazgonDepoEA

RazgonDepo_EA: a versatile Expert Advisor for XAUUSD (M5) – comparison of 5 approaches

Keywords: forex expert advisor, XAUUSD, M5, backtesting, counter-trend strategy, trend strategy, Bollinger Bands bounce, volatility breakout, dynamic lot, fixed lot, risk management, tick volume, test results, optimal settings.

Introduction

The gold market (XAUUSD) remains one of the most volatile and liquid in Forex. Successful trading requires a reliable automated system that can adapt to different market conditions. The RazgonDepo_EA has been developed precisely for this purpose. It combines two independent algorithms: global trend detection and precise entry based on volatility confirmed by volume. In this article, we present the results of testing the Expert Advisor on historical data over two years (2024–2026) on the M5 timeframe and compare five configuration options – from counter-trend to trend-following, with varying degrees of aggressiveness and different entry modes.

Strategy Overview

RazgonDepo_EA uses a combination of two blocks:

  1. Trend filter – based on moving averages (SMA) with periods 50 and 200. It determines the long-term price direction and changes it only when a persistent signal appears.

  2. Signal block – analyzes the price position relative to Bollinger Bands (period 20, deviation 2.0) and tick volume. Depending on the selected mode ( BB_InvertSignals ), it generates entries:

Special attention is paid to money management:

  • Dynamic lot – position size changes depending on series of profitable/loss-making trades, allowing faster deposit growth after a successful streak and risk reduction after drawdowns.

  • Fixed lot – you can disable dynamic lot and trade a constant volume.

  • Margin control – before opening a position, sufficient free margin is checked; if necessary, the lot is automatically reduced.

  • Position limits – for hedging accounts, you can limit the number of simultaneously open positions in one direction.

Five Configuration Approaches

We tested five parameter sets reflecting different trading styles. All tests were performed on XAUUSD, M5, from 01.01.2024 to 01.01.2026 (two years), starting deposit $10,000, leverage 1:100. History quality – 99%. The first test (counter-trend moderate) covered a slightly longer period up to 16.03.2026, but it is included for qualitative comparison.

1. Counter-trend moderate (breakout, dynamic lot, up to 3 positions)

  • Entry mode: volatility breakout ( BB_InvertSignals=true ).

  • Filters: disabled ( Local_UsePivotFilter=false ,  BB_UseSMAFilter=false ).

  • Lot: dynamic (BaseLot=0.1, MaxLot=0.1).

  • Positions: up to 3 simultaneously.

  • Period: 2024.01.01 – 2026.03.16 (slightly longer).

2. Trend aggressive (breakout, filters on, MaxLot=0.2, 3 positions)

  • Entry mode: breakout.

  • Filters:  Local_UsePivotFilter=true ,  BB_UseSMAFilter=true .

  • Lot: dynamic (BaseLot=0.1, MaxLot=0.2).

  • Positions: up to 3.

3. Trend conservative (breakout, filters on, MaxLot=0.1, 1 position)

  • Entry mode: breakout.

  • Filters: on.

  • Lot: dynamic (MaxLot=0.1).

  • Positions: 1.

4. Trend moderate-conservative (breakout, filters on, MaxLot=0.1, 2 positions)

  • Entry mode: breakout.

  • Filters: on.

  • Lot: dynamic (MaxLot=0.1).

  • Positions: up to 2.

5. Counter-trend bounce (fixed lot 0.1, 1 position)

  • Entry mode: bounce from bands ( BB_InvertSignals=false ).

  • Filters: off ( BB_UseSMAFilter=false ).

  • Lot: fixed 0.1 (dynamic disabled).

  • Positions: 1.

Test Results

The main metrics are summarized in the table:

Approach Net Profit, $ Max Drawdown, $ Recovery Factor % Profitable Trades Number of Trades
1. Counter-trend moderate (breakout, 3 pos, dynamic) 32,057* 6,033 4.67 26.0% 1103
2. Trend aggressive (breakout, filters, 3 pos, MaxLot=0.2) 49,724 7,755 5.58 42.0% 1090
3. Trend conservative (breakout, filters, 1 pos, MaxLot=0.1) 9,863 1,769 5.39 41.5% 390
4. Trend moderate-conservative (breakout, filters, 2 pos, MaxLot=0.1) 19,106 2,603 6.62 41.8% 748
5. Counter-trend bounce (fixed lot 0.1, 1 pos) 19,709 3,434 5.33 28.2% 301

Note: Test #1 covers a longer period (up to 16.03.2026), so its profit is slightly higher, but it is still valid for qualitative comparison.

Analysis:

  • Counter-trend moderate (#1) shows decent profit but requires high psychological resilience due to long losing streaks (up to 45 in a row). The share of profitable trades is only 26%, yet the average win significantly exceeds the average loss.

  • Trend aggressive (#2) yields the highest absolute profit (nearly $50,000), but the drawdown reaches 35%, which is close to critical for many traders.

  • Trend conservative (#3) – the safest option: drawdown below 9%, but profit is modest (less than $10,000 over two years).

  • Trend moderate-conservative (#4) – the optimal balance among trend strategies. With a drawdown of only 9%, profit amounts to $19,106, and the recovery factor of 6.62 is the best among all tests. This means that for every dollar of maximum drawdown, the Expert Advisor earned $6.62 in net profit.

  • Counter-trend bounce (#5) – an interesting alternative for counter-trend enthusiasts. With a fixed lot and a single position, it achieves a profit similar to the trend moderate-conservative ($19,709) but with fewer trades (only 301) and a much higher average profit per trade ($762 vs. $211). However, the drawdown is higher at 18%, and the recovery factor is slightly lower (5.33). This approach suits traders who prefer rare but large wins and can tolerate moderate drawdowns.

Recommendations for Choosing Settings

For most traders focused on steady growth with controlled risk, we recommend the trend moderate-conservative approach (#4). It allows decent profit without exposing the deposit to excessive fluctuations.

If you are willing to take higher risk for maximum returns, consider the trend aggressive version (#2). For conservative trading with minimal drawdowns, choose trend conservative (#3).

The counter-trend bounce (#5) may appeal to those who want a counter-trend logic with few trades and a fixed lot. However, be aware of the higher drawdown and potentially long flat periods.

Before running on a live account, be sure to test the Expert Advisor on current data and ensure that the parameters match your broker's requirements (minimum lot, volume step, etc.).

Conclusion

RazgonDepo_EA is a flexible tool for automated trading on XAUUSD. Two years of historical testing confirmed its effectiveness in various market conditions. Choose the trading style that suits you, and may your profits grow!



Mais do autor
I would like to introduce you to a trading assistant for trading gold (XAUUSD) and cryptocurrency. The code implements a counter-trend trading strategy. The indicator identifies local peaks (potential trend reversals). . Sound alerts are also implemented in the code! Trading Recommendations: Instrument: GOLD (XAUUSD) Timeframe: M15 Open trades on the second signal in a series Do not forget to move positions to breakeven Settings: Period = 50; Period = 200; Pips = 4000; Distance_Pips = 4000 The
FREE
ShadowTraderEA
Sergei Vassunov
Dear Traders! I am pleased to present   ShadowTrader_EA   – an expert advisor developed as a result of deep analysis and optimization of a trading strategy specifically designed for volatile instruments, primarily XAUUSD (gold). The advisor has been ported from MQL4 to MQL5 while preserving the original logic and enhanced with modern adaptive capital management mechanisms. What is ShadowTrader_EA? It is a fully automated trading system that opens positions based on a combination of price channel
Filtro:
Sem comentários
Responder ao comentário