Exp_EMA_Prediction
This EA trades based on signals from the custom EMA_Prediction indicator, which uses two EMAs (fast and slow) to predict price direction. It opens buy positions on upward prediction signals and sell positions on downward prediction signals, with configurable stop loss, take profit, and position closing logic. The EA supports multiple money management modes and allows independent control of entry and exit for both long and short positions.
Open the interactive view (equity curve, symbol switch)Key facts
Backtest results (H1, about 1 year)
Not backtested yet — this EA could not be converted automatically.
Strategy analysis
The core strategy of this EA is a trend-following system based on the EMA_Prediction indicator. Entry conditions: a buy position is opened when the indicator's upward signal line (buffer 1) produces a non-zero, non-empty value on the specified signal bar; a sell position is opened when the downward signal line (buffer 0) produces a non-zero, non-empty value. Exit conditions: positions are closed when the indicator produces a reverse signal on historical bars, and also through fixed StopLoss and TakeProfit parameters. Position sizing is controlled by the MM parameter, supporting five modes: by free margin, by balance, by free margin after losses, by balance after losses, and fixed lot size. The EA implements a new bar detection mechanism to prevent repeated entries within the same bar, and allows per-tick signal checking when the signal bar is set to zero. When both entry and exit are enabled and no current close signal exists, the EA backtracks through historical bars to find earlier reverse signals for closing decisions.
Strengths
- Supports multiple money management modes with high flexibility to accommodate different risk preferences
- Buy and sell entry/exit can be independently controlled, facilitating strategy optimization and directional bias filtering
- Implements new bar detection mechanism to prevent repeated entries within the same candle, reducing overtrading
- Complete stop loss and take profit parameters provide a fundamentally sound risk control framework
- Signal recount mechanism (Recount flag) improves fault tolerance for indicator data reading
Weaknesses
- Fast EMA period of 1 and slow EMA period of 2 are extremely small, likely generating excessive false signals and overtrading
- Historical bar backtracking exit logic is inefficient, potentially iterating through large amounts of data and delivering delayed close signals
- Lacks spread filter, trading session restrictions, and maximum position count controls as risk management measures
- Depends on the custom EMA_Prediction indicator which must be separately compiled and deployed, increasing maintenance complexity
- No trailing stop or breakeven functionality, meaning profitable positions may lose most gains during pullbacks
Possible improvements
- Add spread filter and trading session restrictions to avoid entries during high spread or low liquidity periods
- Optimize historical bar backtracking exit logic by limiting lookback depth or replacing with ATR-based dynamic stops
- Add trailing stop and breakeven functionality to better protect unrealized profits
- Recommend adjusting default EMA periods to more reasonable values (e.g., 8 and 21) to reduce false signals
Risk assessment
Overall risk: Medium
- EMA periods of 1 and 2 generate extremely frequent signals, potentially causing overtrading and high transaction costs
- Historical bar backtracking exit logic may delay position closing during strong trends, leading to unnecessary losses
- Lack of spread filter may result in immediate losses when opening positions during high spread periods
Evaluation scores
Parameters
| Parameter | Default | Description |
|---|---|---|
MM | 0.1 | Money management ratio controlling risk per trade |
MMMode | LOT | Lot mode: Free margin/Balance/Balance after loss/Fixed lot |
StopLoss_ | 1000 | Stop loss in points |
TakeProfit_ | 2000 | Take profit in points |
Deviation_ | 10 | Maximum allowed slippage |
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_H6 | Indicator calculation timeframe |
FastMAPeriod | 1 | Fast EMA period |
FastMAType | MODE_EMA | Fast MA calculation method |
FastMAPrice | PRICE_CLOSE | Fast MA applied price |
SlowMAPeriod | 2 | Slow EMA period |
SlowMAType | MODE_EMA | Slow MA calculation method |
SlowMAPrice | PRICE_CLOSE | Applied price for slow MA |
SignalBar | 1 | Bar index for trade signal |
Similar Trend Following EAs
Backtests are historical simulations and do not guarantee future results. Not financial advice.