Exp_MA_Rounding_Candle_MMRec
This EA trades based on the MA_Rounding_Candle custom indicator, which applies a rounding coefficient to a smoothed moving average and generates buy/sell signals from the rounded candle colors. It features adaptive money management that reduces position size after consecutive losses and uses separate magic numbers for long and short positions.
Open the interactive view (equity curve, symbol switch)Key facts
Backtest results (H1, about 1 year)
| Symbol | P&L | Annual | Max DD | Trades | Win rate | Sharpe | Recovery | Losing streak | Per trade | Status |
|---|---|---|---|---|---|---|---|---|---|---|
| EURUSD | +6.01% | +5.20% | 4.57% | 80 | 51.90% | 1.21 | 1.31 | 6 | +$8.04 | Reliable |
| GBPUSD | +0.50% | +0.44% | 5.26% | 81 | 44.40% | 0.11 | 0.10 | 6 | +$0.62 | Reliable |
| USDJPY | -5.19% | -4.53% | 8.41% | 129 | 47.70% | -0.84 | -0.62 | 6 | −$4.11 | Reliable |
| XAUUSD | -52.39% | -45.84% | 85.81% | 74 | 47.30% | -0.05 | -0.61 | 6 | −$70.80 | Reliable |
Profitable on 2 of 4 markets with reliable results.
Converted from MQL5 to Python and run with the same rules for every EA. Positions use MT5 lot sizes (100,000 units per FX lot, 100 oz per gold lot) with 1:100 leverage, one order at a time, and a stop-out below 10% of the starting balance. Sharpe is computed from the equity curve. Results marked as unreliable are shown for completeness only.
Against the other Trend Following EAs with a reliable result on the same market: EURUSD: better than 92% of 95 · GBPUSD: better than 51% of 95 · USDJPY: better than 15% of 95 · XAUUSD: better than 21% of 96
Month by month
| Market | Months with a gain | Best month | Worst month |
|---|---|---|---|
| EURUSD | 62% | +2.21% 2026-03 | -2.28% 2026-02 |
| GBPUSD | 54% | +2.48% 2026-01 | -2.85% 2026-10 |
| USDJPY | 54% | +1.48% 2026-05 | -2.45% 2026-08 |
| XAUUSD | 23% | +53.38% 2026-11 | -45.00% 2026-10 |
From the backtest equity curve, sampled about every two days; only reliable results.
Blow-up risk: No blow-up pattern found
None of the usual blow-up patterns were found in the code, and the account was not stopped out in our backtests. That is not a guarantee: any EA can lose money.
High: stopped out in our backtest, or martingale/grid sizing without a stop loss. Elevated: martingale or grid sizing with a stop loss, or several positions at once without a stop loss. What the label means and what we found →
Strategy analysis
The strategy concept is based on the MA_Rounding_Candle custom indicator, which applies a rounding coefficient to a smoothed moving average and generates candlestick-style signals from the rounded values. Entry conditions: when indicator buffer value equals 2, a buy signal is generated (confirmed if previous value was not 2); when value equals 0, a sell signal is generated (confirmed if previous value was not 0). Exit conditions include closing opposite positions on signal reversal and using fixed StopLoss and TakeProfit in points. Position management uses separate magic numbers for long and short positions, allowing independent control of each direction. Money management is the core feature — the BuyTradeMMRecounterS and SellTradeMMRecounterS functions adjust position size based on the number of losing trades among the last N trades, reducing exposure to SmallMM_ ratio during losing streaks and using MM ratio during normal trading. This adaptive money management mechanism helps effectively control drawdowns during adverse market conditions.
Strengths
- Adaptive money management: dynamically adjusts position size based on recent trade losses, automatically reducing exposure to SmallMM_ ratio during drawdowns, effectively controlling risk
- Independent long/short management: uses separate magic numbers and independent MM parameters for each direction, allowing granular control over trading behavior and risk per direction
- Signal deduplication: prevents duplicate entries by comparing current and previous indicator values, and uses IsNewBar check to ensure signals are calculated only once per bar
- Supports 10 smoothing algorithms: offers multiple MA methods (SMA/EMA/JJMA/JurX/T3/VIDYA/AMA etc.), providing high strategy flexibility
- Default 2:1 reward-to-risk ratio: TakeProfit is twice StopLoss (2000 vs 1000 points), pursuing a positive expectancy trading system
Weaknesses
- Depends on custom indicator: EA relies on external MA_Rounding_Candle indicator; missing or mismatched indicator file will cause runtime failure
- No spread filter: EA lacks spread checking, potentially causing excessive entry costs in high-spread environments, especially detrimental for shorter-term trading
- Fixed SL/TP in points: uses fixed point-based stop loss and take profit rather than dynamic ATR-based levels, unable to adapt to varying market volatility
- MMMode defaults to LOT: default money management mode is fixed lot rather than dynamic calculation based on account balance or free margin, potentially underutilizing the adaptive MM feature
- No forced new bar check: when SignalBar is 0, the IsNewBar check is skipped, potentially causing repeated signal calculations within the same bar and logical confusion
Possible improvements
- Add spread filter: check current spread against a threshold before entry, avoiding opening positions during high-spread periods
- Use ATR-based dynamic SL/TP: replace fixed point-based stop loss and take profit with ATR-based dynamic calculation to better adapt to changing market volatility
Risk assessment
Overall risk: Medium
- StopLoss of 1000 points is large but 2:1 R:R is reasonable; slippage impact needs monitoring
- Adaptive MM only reduces ratio from 0.1 to 0.01 (10x reduction) during losses; effective but may not be conservative enough in extreme market conditions
- SignalBar=0 skips IsNewBar check, potentially causing repeated signal calculation within the same bar
Evaluation scores
Parameters
| Parameter | Default | Description |
|---|---|---|
BuyMagic | 777 | Magic number for Buy direction |
SellMagic | 888 | Magic number for Sell direction |
BuyTotalMMTriger | 5 | Recent trades for Buy stop loss calculation |
BuyLossMMTriger | 3 | Loss trade count threshold to reduce Buy MM |
SellTotalMMTriger | 5 | Recent trades for Sell stop loss calculation |
SellLossMMTriger | 3 | Loss trade count threshold to reduce Sell MM |
SmallMM_ | 0.01 | Fund ratio per trade during losing streak |
MM | 0.1 | Fund ratio per trade under normal conditions |
MMMode | LOT | Lot sizing method (Free Margin/Balance/Loss/Fixed Lot) |
StopLoss_ | 1000 | Stop loss in points |
TakeProfit_ | 2000 | Take profit in points |
Deviation_ | 10 | Maximum price deviation in points (slippage tolerance) |
BuyPosOpen | true | Allow opening long positions |
SellPosOpen | true | Allow opening short positions |
BuyPosClose | true | Allow closing long positions |
SellPosClose | true | Allow closing short positions |
InpInd_Timeframe | PERIOD_H1 | Timeframe for MA_Rounding_Candle indicator |
XMA_Method | MODE_SMA_ | MA smoothing method (SMA/EMA/SMMA/LWMA/JJMA/JurX/ParMA/T3/VIDYA/AMA) |
XLength | 12 | Smoothing depth (MA period) |
XPhase | 15 | Smoothing parameter (-100 to +100 for JJMA, CMO period for VIDYA, slow MA period for AMA) |
MaRound | 50 | Rounding coefficient |
Gap | 10 | Gap size in points to ignore |
SignalBar | 1 | Entry signal bar index |
Similar Trend Following EAs
Backtests are historical simulations and do not guarantee future results. Not financial advice.