Exp_MACDCandle
This EA trades based on the MACDCandle custom indicator, generating buy signals when the MACD histogram transitions to bullish (value 2) and sell signals when it transitions to bearish (value 0). It supports two operating modes: histogram crossover and signal line crossover, with configurable position sizing, stop loss, and take profit levels.
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 | 0.00% | 0.00% | 0.00% | 0 | — | — | — | — | — | Not convertible yet |
| GBPUSD | 0.00% | 0.00% | 0.00% | 0 | — | — | — | — | — | Not convertible yet |
| USDJPY | 0.00% | 0.00% | 0.00% | 0 | — | — | — | — | — | Not convertible yet |
| XAUUSD | 0.00% | 0.00% | 0.00% | 0 | — | — | — | — | — | Not convertible yet |
Why this EA never traded: no entry rule survived the conversion.
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.
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 MACD momentum changes, using a custom MACDCandle indicator that encodes MACD states into discrete values (0, 2, etc.) to generate trading signals. Entry conditions: a buy signal is generated when indicator buffer 4 transitions from non-2 to 2, and a sell signal when it transitions from non-0 to 0, essentially capturing shifts in MACD momentum direction. Exit conditions rely on fixed stop loss (1000 points) and take profit (2000 points), while also closing positions on reverse signals — closing sells on buy signals and closing buys on sell signals. Position sizing supports two modes: fixed lot size (LOT) or margin-based percentage (MM parameter defaults to 0.1), implemented through the TradeAlgorithms.mqh library functions. Money management features a 1:2 risk-reward ratio, but lacks trailing stops and dynamic position adjustment, making risk control relatively static and inflexible.
Strengths
- Clear strategy logic based on the classic MACD momentum indicator with solid theoretical foundation
- Provides stop loss and take profit protection with a 1:2 risk-reward ratio, favorable for long-term expectancy
- Independent on/off switches for buy and sell directions offer high trading flexibility
- Uses IsNewBar check to prevent repeated trades within the same bar, reducing overtrading risk
- Clean code structure with modular use of TradeAlgorithms library, easy to maintain
Weaknesses
- Fixed stop loss and take profit in points without considering market volatility (ATR), poor adaptability across instruments and market conditions
- Lacks trailing stop mechanism, potentially losing most profits during strong trending moves due to retracements
- Depends on a custom MACDCandle indicator, increasing deployment complexity and dependency risk
- No trading session filter, may generate unfavorable signals during low-liquidity periods
- No spread filter or margin sufficiency check, which may cause anomalies during high spread or insufficient margin conditions
Possible improvements
- Introduce ATR-based dynamic stop loss and take profit to adapt risk management to different instruments' volatility characteristics
- Add trailing stop functionality to lock in more profits during trending markets
- Add trading session filter and spread filter to avoid trading under unfavorable market conditions
Risk assessment
Overall risk: Medium
- Fixed 1000-point stop loss may be too large or too small during significant volatility changes, failing to effectively protect capital
- No spread filter means high-spread environments could trigger stops with expanded slippage
- Dependency on external custom indicator means missing indicator file will cause EA initialization failure
Evaluation scores
Parameters
| Parameter | Default | Description |
|---|---|---|
MM | 0.1 | Money management parameter (lot or ratio) |
MMMode | LOT | Position sizing mode (free margin/balance/net free margin/net balance/fixed lot) |
StopLoss_ | 1000 | Stop loss in points |
TakeProfit_ | 2000 | Take profit in points |
Deviation_ | 10 | Maximum allowed slippage in points |
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_H4 | Indicator calculation timeframe |
SignalBar | 1 | Bar index for signal retrieval |
fast_ema_period | 12 | Fast EMA period |
slow_ema_period | 26 | Slow EMA period |
signal_period | 9 | Signal line period |
mode | MODE_SIGNAL_LINE | MACD signal mode (histogram/signal line) |
Similar Momentum EAs
Backtests are historical simulations and do not guarantee future results. Not financial advice.