EMA Cross Contest Hedged
This EA trades EMA crossover signals with an optional MACD filter, placing a main market order plus 4 hedge pending orders at fixed intervals. It uses trailing stops for open positions and optionally closes opposite positions on signal reversal. The hedging mechanism creates a ladder of stop orders in the direction of the trend to scale into 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 strategy concept is based on the crossover of a short-period EMA and a long-period EMA to determine trend direction, with an uptrend signaled when the short EMA crosses above the long EMA and a downtrend when it crosses below. Entry conditions require an EMA crossover plus an optional MACD filter (long requires MACD main line >= 0, short requires MACD main line <= 0), and upon entry the EA places a market order along with 4 stop orders spaced at 1x to 4x the HedgeLevel distance, creating a ladder of scaling-in positions. Exit conditions include fixed stop loss and take profit levels, as well as a trailing stop that only activates when unrealized profit exceeds TrailingStop plus TrailingStep. Position sizing uses a fixed lot size with no dynamic adjustment based on account equity or risk percentage. Money management lacks a maximum position limit, and the combination of a market order plus 4 pending stop orders means a single signal can result in up to 5 simultaneous positions, creating significant risk exposure.
Strengths
- Uses EMA crossover combined with optional MACD filter for higher signal quality than a single indicator
- Trailing stop mechanism locks in floating profits and reduces drawdowns
- Pending orders have expiration times, preventing invalid entries from stale signals
- Automatic 3/5 digit point adjustment ensures compatibility with different symbol formats
- Volume validation check prevents orders with invalid lot sizes
Weaknesses
- A single signal can create 5 positions (1 market + 4 pending), with no maximum position control creating excessive risk exposure
- Trailing stop of only 30 pips with 1 pip step is too tight and likely to get stopped out in volatile markets
- Hedge level of only 6 pips between pending orders is too dense, all 4 could fill rapidly in fast markets causing large losses
- No total position count check means multiple signals can accumulate excessive directional exposure
- Stop loss of 140 pips vs take profit of 120 pips gives a risk-reward ratio below 1, which is unfavorable long-term
Possible improvements
- Add a maximum simultaneous position count limit to prevent uncontrolled risk exposure
- Link HedgeLevel dynamically to ATR so that pending order spacing adapts to market volatility
- Improve risk-reward ratio by setting take profit larger than stop loss or using dynamic take profit targets
Risk assessment
Overall risk: High risk
- Single signal can open up to 5 positions with no maximum position limit, risk exposure can expand rapidly
- Pending order spacing of only 6 pips is too dense, all could fill rapidly in extreme markets causing massive losses
- Risk-reward ratio below 1 is statistically unfavorable long-term
- No check on existing pending orders, repeated signals could stack even more pending orders increasing risk
Evaluation scores
Parameters
| Parameter | Default | Description |
|---|---|---|
InpLots | 0.1 | Fixed trading lot size |
InpStopLoss | 140 | Stop loss in points |
InpTakeProfit | 120 | Take profit in points |
InpTrailingStop | 30 | Trailing stop distance in points |
InpTrailingStep | 1 | Trailing stop step in points |
InpHedgeLevel | 6 | Hedge pending order interval in points |
InpCloseOpposite | false | Close opposite position on signal reversal |
InpUseMACD | false | Enable MACD filter |
InpExpiration | 65535 | Pending order expiration time in seconds |
InpShort_ma_period | 4 | Short-term EMA period |
InpLong_ma_period | 24 | Long-term EMA period |
InpCurrentBar | previous | Trading bar: current or previous |
m_magic | 154246789 | Magic number to identify strategy positions |
Similar Hedging EAs
Backtests are historical simulations and do not guarantee future results. Not financial advice.