Gap DM
This EA detects price gaps at market open or between candles and trades on the expectation that gaps will be filled or continue in the gap direction. It systematically identifies gap conditions, enters positions based on gap size and direction, and manages trades with configurable 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 core strategy of this EA is based on price gap breakout trading, triggering trade signals when a significant gap is detected between the current open price and the previous period's close price. Entry conditions require the gap size to exceed a configurable minimum threshold, going long on upside gaps and short on downside gaps depending on the strategy mode. Exit conditions include fixed stop loss and take profit levels, as well as a gap-fill closure logic that closes positions when the price returns to fill the gap. Position sizing uses either fixed lot sizes or dynamic lot calculation based on account equity percentage. Money management provides parameters for maximum open positions and daily loss limits to control overall exposure. The strategy operates on the assumption that most gaps will be filled in the short term, making it a systematic gap-trading approach that can trade either in the direction of the gap or against it for gap-fill plays.
Strengths
- Gap trading logic is clear and based on statistically validated market phenomena
- Provides both gap-fill and gap-continuation modes for strategic flexibility
- Includes risk control parameters such as maximum positions and time filters
- Configurable gap size thresholds prevent over-trading on minor gaps
- Strategy concept is easy to understand and validate, suitable for further optimization
Weaknesses
- Gap strategy may generate false signals in low-liquidity markets
- Lacks dynamic correlation between gap size and stop loss/take profit levels
- Does not consider the overall market trend context when gaps occur
- Fixed pip-based SL/TP lacks adaptability across different volatility environments
- Missing strict new bar detection may lead to repeated entries within the same candle
Possible improvements
- Add ATR-based dynamic SL/TP to automatically adjust exit levels based on market volatility
- Add a trend filter (e.g., moving average direction) to avoid trading against the trend on gaps
- Implement dynamic position sizing mapped to gap size, scaling up on larger gaps with proper risk limits
Risk assessment
Overall risk: Medium
- Gap trading may face extended slippage on stop losses during post-news sustained directional moves
- Fixed stop loss may be insufficient to cover risk in extreme volatility conditions
- Lacks real-time account-level risk monitoring and forced liquidation mechanism
Evaluation scores
Parameters
| Parameter | Default | Description |
|---|---|---|
GapMinimumPoints | 50 | Minimum gap threshold in points |
GapMaximumPoints | 300 | Maximum gap threshold in points |
StopLoss | 200 | Stop loss in points |
TakeProfit | 400 | Take profit in points |
Lots | 0.1 | Fixed trading lot size |
MagicNumber | 23223 | Unique order identifier number |
MaxPositions | 3 | Maximum simultaneous positions |
GapMode | 1 | Gap trading mode: 1=gap fill, 2=gap follow |
TimeFilter | true | Enable trading session filter |
StartHour | 0 | Trading start hour |
EndHour | 24 | Trading end hour |
Similar Breakout EAs
Backtests are historical simulations and do not guarantee future results. Not financial advice.