Gaps
This EA trades price gaps (window gaps) that occur between candle closes and opens, entering positions in the direction of gap fill expectation. It identifies gaps on the current timeframe and places market orders expecting the gap to be closed by price retracement.
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 | -3.56% | -3.10% | 7.29% | 144 | 45.10% | -0.80 | -0.49 | 6 | −$2.47 | Reliable |
| GBPUSD | -4.96% | -4.33% | 8.29% | 144 | 47.60% | -0.81 | -0.60 | 6 | −$3.64 | Reliable |
| USDJPY | +4.20% | +3.64% | 3.61% | 144 | 58.70% | 0.87 | 1.16 | 5 | +$2.83 | Reliable |
| XAUUSD | +2.21% | +1.82% | 64.75% | 150 | 52.00% | 0.46 | 0.03 | 6 | +$1.47 | 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 Breakout EAs with a reliable result on the same market: EURUSD: better than 11% of 18 · GBPUSD: better than 17% of 18 · USDJPY: better than 88% of 17 · XAUUSD: better than 47% of 19
Month by month
| Market | Months with a gain | Best month | Worst month |
|---|---|---|---|
| EURUSD | 38% | +0.99% 2025-12 | -1.59% 2026-03 |
| GBPUSD | 54% | +1.85% 2026-07 | -2.65% 2026-05 |
| USDJPY | 77% | +1.22% 2026-03 | -1.24% 2026-07 |
| XAUUSD | 54% | +71.05% 2026-08 | -33.67% 2026-02 |
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
The strategy concept is based on the gap fill theory, which posits that price tends to retrace and fill gaps that occur between candle closes and opens. Entry conditions detect a significant price gap between the current candle open and the previous candle close — an upward gap triggers a sell order expecting gap fill, while a downward gap triggers a buy order. Exit conditions typically involve take-profit at the gap fill level, with stop-loss placed at a calculated distance beyond the gap. Position sizing generally uses fixed lot sizes or a percentage of account equity. Money management may include basic stop-loss and take-profit ratio controls but lacks sophisticated money management modules. The core assumption is that gaps have a high probability of being filled, but in strong trending markets gaps may persist without being filled, leading to losses.
Strengths
- Gap fill is a statistically validated phenomenon with relatively high win rate across most market conditions
- Strategy logic is simple and clear, easy to understand and verify, with few parameters for optimization
- Entry conditions are objective and well-defined, free from subjective judgment, suitable for systematic trading
Weaknesses
- In strong trending markets gaps may not fill, leading to significant losses
- Lacks multi-timeframe confirmation, potentially trading false gaps on the wrong timeframe
- Does not account for the erosion of gap fill profits by trading costs and slippage
Possible improvements
- Add multi-timeframe gap confirmation mechanism to filter low-quality gap signals
- Incorporate a trend filter to avoid counter-trend gap fill trading during strong trends
Risk assessment
Overall risk: Medium
- Gap non-fill risk: In strong trends, gaps may widen instead of filling, triggering stop-losses
- Weekend gap risk: Monday opening gaps may suffer severe slippage due to low liquidity, making stop-losses ineffective
Evaluation scores
Parameters
| Parameter | Default | Description |
|---|---|---|
LotSize | 0.1 | Fixed lot size (used when MMRec disabled) |
GapMinimumPoints | 50 | Minimum gap points threshold; no trade below this |
StopLoss | 200 | Stop loss in points |
TakeProfit | 100 | Take profit in points, typically set at gap close |
MagicNumber | 12345 | EA magic number for order identification |
MaxPositions | 1 | Maximum simultaneous positions |
Similar Breakout EAs
Backtests are historical simulations and do not guarantee future results. Not financial advice.