Exp_BBSqueeze
This EA trades based on the BBSqueeze indicator, which detects Bollinger Band squeeze (low volatility) breakout conditions. It opens long positions when the upper histogram bar is non-empty and the previous lower bar confirms direction, and vice versa for shorts. Positions are managed with fixed Stop Loss and Take Profit levels, with optional money management based on deposit share.
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 | -2.44% | -2.12% | 5.87% | 145 | 43.10% | — | — | — | — | Custom indicator approximated |
| GBPUSD | +3.28% | +2.84% | 4.19% | 145 | 47.90% | — | — | — | — | Custom indicator approximated |
| USDJPY | -1.30% | -1.13% | 5.64% | 145 | 59.00% | — | — | — | — | Custom indicator approximated |
| XAUUSD | +119.89% | +91.75% | 30.57% | 152 | 51.70% | — | — | — | — | Custom indicator approximated |
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 strategy concept is based on the Bollinger Band Squeeze breakout, which anticipates a directional move after market volatility compresses to extremely low levels. Entry conditions are: when the BBSqueeze indicator's upper histogram value (UpValue) is non-empty and not EMPTY_VALUE, combined with the previous bar's lower histogram value (DnValue) confirmation, a buy signal is triggered; conversely, when the lower histogram value is non-empty and confirmed by the upper histogram, a sell signal is triggered. Exit conditions rely on fixed Stop Loss (default 1000 points) and Take Profit (default 2000 points), yielding a reward-to-risk ratio of 2:1. Position sizing is controlled by the MM parameter, where negative values represent fixed lot sizes and positive values represent deposit-share-based lot calculation. Money management is handled by functions in TradeAlgorithms.mqh, supporting dynamic position calculation based on account balance. The strategy defaults to the H4 timeframe and uses SignalBar=1 (the previous closed bar) to avoid look-ahead bias, with a new bar detection mechanism ensuring signals are only calculated at bar close.
Strengths
- Bollinger Band squeeze breakout is a classic strategy concept with statistical support, as low-to-high volatility transitions are relatively predictable
- Using SignalBar=1 ensures signals are generated only after bar close, avoiding look-ahead bias
- Complete buy/sell toggle controls allow flexible directional trading (long-only, short-only, or both)
- The 2:1 reward-to-risk ratio design supports long-term positive expectancy
- New bar detection mechanism prevents repeated calculations and duplicate trades within the same bar
Weaknesses
- No trailing stop functionality, which may cause significant profit drawdown before the fixed take profit is hit
- Lacks spread filter and trading session filter, potentially leading to unfavorable fills during low-liquidity periods
- Stop loss of 1000 points and take profit of 2000 points may be excessive for H4, easily triggered in choppy markets
- Depends on the external custom indicator BBSqueeze, increasing deployment complexity and dependency risk
- No position check logic, potentially opening duplicate positions in the same direction
Possible improvements
- Add a trailing stop feature to lock in partial profits when price moves favorably, improving risk-adjusted returns
- Add position checking and maximum position limits to prevent duplicate directional entries and over-concentration risk
Risk assessment
Overall risk: Medium
- Lack of position checking may cause duplicate directional entries, creating excessive exposure
- Fixed stop loss/take profit does not adapt to market volatility changes, potentially causing frequent stop-outs during high-volatility periods
- No spread filter means trades execute even when spreads widen
Evaluation scores
Parameters
| Parameter | Default | Description |
|---|---|---|
MM | -0.1 | Trade deposit fraction, negative for fixed lot |
StopLoss_ | 1000 | Stop loss in points |
TakeProfit_ | 2000 | Take profit in points |
Deviation_ | 10 | Max price deviation in points (slippage tolerance) |
BuyPosOpen | true | Allow opening long positions |
SellPosOpen | true | Allow opening short positions |
BuyPosClose | true | Allow closing long positions |
SellPosClose | true | Allow closing short positions |
InpInd_Timeframe | PERIOD_H4 | Indicator timeframe |
BB_Method | MODE_EMA_ | Bollinger Bands histogram smoothing method |
BB_Period | 20 | Bollinger Bands period |
BB_Phase | 100 | Bollinger Bands smoothing parameter |
BB_Deviation | 2.0 | Bollinger Bands deviation multiplier |
AppliedPrice | PRICE_CLOSE_ | Applied price type |
SignalBar | 1 | Bar index for entry signal |
Similar Breakout EAs
Backtests are historical simulations and do not guarantee future results. Not financial advice.