MACD and SAR
This EA combines MACD and Parabolic SAR indicators to identify trend-following trade opportunities. It enters trades when both indicators confirm the same trend direction, using MACD for momentum confirmation and SAR for trend direction and trailing stops. The dual-indicator approach aims to filter out false signals by requiring confluence from both momentum and trend indicators.
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.24% | +0.21% | 3.98% | 130 | 47.30% | 0.07 | 0.06 | 5 | +$0.45 | Reliable |
| GBPUSD | +2.29% | +1.99% | 3.59% | 129 | 50.00% | 0.45 | 0.64 | 4 | +$1.98 | Reliable |
| USDJPY | -6.47% | -5.65% | 9.60% | 128 | 51.60% | -1.18 | -0.67 | 5 | −$5.05 | Reliable |
| XAUUSD | -39.73% | -34.19% | 75.80% | 136 | 48.90% | 0.11 | -0.52 | 6 | −$27.59 | 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 60% of 95 · GBPUSD: better than 63% of 95 · USDJPY: better than 11% of 95 · XAUUSD: better than 27% of 96
Month by month
| Market | Months with a gain | Best month | Worst month |
|---|---|---|---|
| EURUSD | 69% | +1.05% 2026-07 | -2.00% 2026-03 |
| GBPUSD | 46% | +2.46% 2026-04 | -1.36% 2026-01 |
| USDJPY | 38% | +2.44% 2025-12 | -2.85% 2026-07 |
| XAUUSD | 38% | +98.66% 2026-07 | -33.82% 2026-05 |
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
This EA employs a dual-indicator trend-following strategy combining MACD and Parabolic SAR. Entry conditions require MACD main line crossing its signal line to confirm momentum direction, while Parabolic SAR dots must align with the same trend direction for trade confirmation. Exit conditions likely rely on SAR reversal dots as trailing stops, or MACD reverse crossover as a close signal. Position sizing typically uses fixed lots or account-equity-proportional lot calculation in standard MQ5 EAs. Money management may include fixed stop-loss and take-profit levels depending on parameter configuration. The strategy benefits from dual-indicator confluence filtering false signals, but suffers in ranging markets where SAR frequently reverses generating multiple losing trades, and MACD as a lagging indicator may cause late entries.
Strengths
- Dual-indicator confluence effectively filters false signals and improves entry quality
- SAR provides dynamic trailing stop mechanism for better profit protection
- Clear and intuitive strategy logic with well-understood parameters for optimization
- Excellent performance in trending markets, capable of capturing large trend swings
Weaknesses
- MACD lagging nature causes late entries, potentially missing optimal prices at trend start
- SAR frequently reverses in ranging markets generating numerous false signals and consecutive losses
- Lacks market regime detection to automatically distinguish trending from ranging conditions
- Typical implementation lacks advanced money management like dynamic position sizing or risk percentage control
Possible improvements
- Add market regime filter (e.g., ADX or ATR) to automatically pause trading in ranging conditions
- Implement dynamic position sizing based on account risk percentage instead of fixed lots
- Add time filter and spread filter to avoid unfavorable trading sessions and high-cost executions
Risk assessment
Overall risk: Medium
- Lacks market regime detection which may cause consecutive losses in ranging markets
- Default SL/TP may be zero, relying on indicator reversal for exit introduces significant slippage risk
- Improper SAR acceleration factor settings may cause stops that are too tight or too loose
Evaluation scores
Parameters
| Parameter | Default | Description |
|---|---|---|
MACD_fast_ema | 12 | MACD fast EMA period |
MACD_slow_ema | 26 | MACD slow EMA period |
MACD_signal_period | 9 | MACD signal line period |
SAR_step | 0.02 | SAR acceleration factor step |
SAR_maximum | 0.2 | SAR maximum acceleration factor |
LotSize | 0.1 | Initial lot size, martingale base quantity |
StopLoss | 0 | Stop loss in points, max loss per trade |
TakeProfit | 0 | Group TP in points, close all at this profit |
Similar Trend Following EAs
Backtests are historical simulations and do not guarantee future results. Not financial advice.