Tunnel gen4
Tunnel Gen4 is a breakout-based Expert Advisor that identifies price tunnel/channel consolidation zones and enters trades when price breaks out of the defined range. It uses configurable tunnel boundaries to detect periods of low volatility followed by directional expansion, managing positions with stop loss and take profit targets.
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.78% | -0.68% | 4.28% | 118 | 49.60% | -0.15 | -0.18 | 5 | −$0.38 | Reliable |
| GBPUSD | +5.15% | +4.46% | 3.71% | 116 | 56.50% | 0.89 | 1.39 | 5 | +$4.69 | Reliable |
| USDJPY | -1.36% | -1.18% | 7.86% | 110 | 48.60% | -0.21 | -0.17 | 5 | −$1.39 | Reliable |
| XAUUSD | +69.33% | +54.52% | 36.59% | 107 | 50.00% | 1.10 | 1.90 | 5 | +$67.74 | 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 39% of 18 · GBPUSD: better than 94% of 18 · USDJPY: better than 29% of 17 · XAUUSD: better than 84% of 19
Month by month
| Market | Months with a gain | Best month | Worst month |
|---|---|---|---|
| EURUSD | 38% | +1.69% 2026-03 | -1.13% 2026-02 |
| GBPUSD | 62% | +2.84% 2025-12 | -1.47% 2026-03 |
| USDJPY | 54% | +2.52% 2026-07 | -2.90% 2025-12 |
| XAUUSD | 54% | +61.98% 2026-01 | -12.55% 2026-08 |
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 price tunnel breakout, entering trades when price breaks out of a narrow consolidation range (tunnel). Entry conditions trigger a buy when price breaks above the upper tunnel boundary and a sell when it breaks below the lower boundary, with optional confirmation via candle close or breakout magnitude threshold. Exit conditions include fixed take profit and stop loss levels, and potentially a reverse breakout closure mechanism that exits when price re-enters or breaks the opposite tunnel boundary. Position sizing uses either fixed lot sizes or balance-proportional calculation methods. Money management incorporates maximum position limits and per-trade risk control parameters, though the overall approach relies on the assumption of trend continuation after breakout, which can produce consecutive losses in false breakout scenarios.
Strengths
- Tunnel breakout strategy has clear logic, entering at trend inception can capture large profit potential
- Configurable breakout threshold helps filter false breakout signals and reduce ineffective trades
- Well-parameterized design allows users to adjust tunnel parameters and risk settings for different instruments and market conditions
Weaknesses
- Frequent false breakouts in ranging markets can lead to consecutive stop losses
- Lacks market regime filter to automatically distinguish trending from ranging conditions
- Breakout strategy is sensitive to slippage and spread, may underperform on high-spread instruments
Possible improvements
- Add ATR or volatility filter to narrow the tunnel or pause trading in low-volatility environments to avoid false breakouts
- Implement multi-timeframe confirmation, requiring higher-timeframe trend direction to align with breakout direction
- Implement dynamic stop loss and take profit that adapt based on ATR or tunnel width for optimal risk-reward ratios
Risk assessment
Overall risk: Medium
- False breakouts in ranging markets can cause consecutive losses
- No market regime identification, continues opening positions in non-trending conditions
- Breakout entries are sensitive to execution slippage, actual fill prices may deviate from expected during high volatility
Evaluation scores
Parameters
| Parameter | Default | Description |
|---|---|---|
TunnelPeriod | 20 | Tunnel calculation period for upper/lower bands |
LotSize | 0.1 | Fixed lot size per trade |
StopLoss | 50 | Stop loss in points |
TakeProfit | 100 | Take profit in points |
BreakoutThreshold | 5 | Minimum breakout confirmation threshold in pips |
MaxPositions | 3 | Maximum simultaneous positions allowed |
MagicNumber | 22659 | Magic number identifier for EA orders |
Timeframe | H1 | Timeframe for channel calculation |
Similar Breakout EAs
Backtests are historical simulations and do not guarantee future results. Not financial advice.