20_200 expert_v4.2_AntS
This EA compares open prices of two bars at configurable shifts and opens a buy or sell position when the price difference exceeds a threshold. It employs a martingale-style lot multiplication after losses and uses a fixed trading hour for entries. Positions are closed by take-profit, stop-loss, or a maximum holding time.
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.
Blow-up risk: Elevated
- Increases the position size after losses (martingale)
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 comparing the open prices of two bars at configurable shifts (t1 and t2): a buy signal triggers when the second bar's open price exceeds the first bar's by more than Delta_L points, and a sell signal triggers when the first bar's open exceeds the second by more than Delta_S points. Entry conditions also restrict trading to a specific hour of the day (TradeTime) and require no existing position. Exit conditions include fixed take-profit and stop-loss in points, plus a forced close after MaxOpenTime hours. Position sizing offers both fixed lots and an auto-lot mode that scales with account balance via a hard-coded lookup table. Money management employs a martingale approach: when the recorded balance from the last trade exceeds the current balance (indicating a loss), the lot size is multiplied by BigLotSize. The OneMult parameter controls whether the multiplied lot is used once or repeatedly for each new position until profit. The LotSize function is an extremely long if-else chain mapping balance from 300 to 273580 to lot sizes from 0.01 to 10.00, with no mathematical formula used.
Strengths
- Clear stop-loss and take-profit settings with defined point values, making risk parameters transparent
- Maximum holding time limit prevents indefinite position trapping
- Uses global variables to track last balance for loss detection, persisting state across EA restarts
Weaknesses
- Martingale strategy causes exponential lot growth on consecutive losses, potentially leading to account blowup
- LotSize function uses nearly 1000 lines of hard-coded if-else statements, extremely difficult to maintain and error-prone
- SignalOpenSell has unreachable return(false) on line 190 — dead code bug
- Only trades during one specific hour per day, severely limiting opportunities with no multi-session validation
- No spread filter, which can erode profits especially with relatively small take-profit values
Possible improvements
- Replace the 1000-line if-else ladder in LotSize with a mathematical formula for maintainability
- Add spread filter and slippage protection to avoid entering during high-spread periods
- Add a maximum consecutive loss count limit to prevent infinite martingale lot escalation
Risk assessment
Overall risk: High risk
- Martingale lot multiplication (BigLotSize=6) amplifies lot size 6x after each loss, extremely likely to cause account blowup
- No free margin check before placing orders with multiplied lot sizes
- SignalOpenSell function has a dead code bug with unreachable return(false) on line 190
Evaluation scores
Parameters
| Parameter | Default | Description |
|---|---|---|
t1 | 6 | Offset of the first bar |
t2 | 2 | Offset of the second bar |
Delta_L | 6 | Min open price difference between two bars for longs (points) |
Delta_S | 21 | Min open price difference between two bars for shorts (points) |
TakeProfit_L | 390 | Long take profit (points) |
StopLoss_L | 1470 | Long stop loss (points) |
TakeProfit_S | 320 | Short take profit (points) |
StopLoss_S | 2670 | Short stop loss (points) |
Lots | 0.1 | Fixed lot size; 0 uses dynamic risk calculation |
AutoLot | true | Enable balance-based automatic lot sizing |
BigLotSize | 6 | Lot multiplier coefficient after a loss |
OneMult | true | Single Martingale multiplier only (otherwise each new position multiplies) |
TradeTime | 14 | Allowed opening hour (server time) |
MaxOpenTime | 504 | Maximum position holding time (hours) |
Similar Martingale EAs
Backtests are historical simulations and do not guarantee future results. Not financial advice.