NightScalper
A multi-symbol night scalping EA that trades Bollinger Band mean reversion signals during specific time windows. It opens buy positions when price touches the lower band and sell positions when price touches the upper band, provided band width is below a threshold. Positions are closed when the trading session ends and new trades are only opened on new bars.
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 | -29.48% | -26.17% | 59.60% | 1 | 0.00% | — | — | — | — | Too few trades |
| GBPUSD | +38.81% | +32.97% | 38.43% | 1 | 0.00% | — | — | — | — | Too few trades |
| USDJPY | +25.01% | +21.41% | 43.08% | 1 | 0.00% | — | — | — | — | Too few trades |
| XAUUSD | -55.24% | -48.53% | 99.61% | 2 | 0.00% | — | — | — | — | Too few trades |
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 a night scalping approach based on Bollinger Band mean reversion, exploiting the tendency of prices to revert within the bands during low-volatility nighttime sessions. Entry conditions are: go long when the Ask price is below the lower Bollinger Band and the band width (upper minus lower) is less than the Razmah threshold in points, and go short when the Bid price is above the upper band with the same band width filter. Exit conditions include fixed stop loss and take profit levels, plus a forced close of all positions on a symbol when the current time is before the Start hour (which effectively defines a time window boundary). Position sizing uses a fixed lot size for all symbols with no dynamic adjustment based on volatility or account equity. Money management is completely absent, as there is no logic to scale position size based on account balance, risk percentage, or any other equity-based metric. The EA supports up to 9 symbols simultaneously, each with independent Bollinger Band parameters, stop loss/take profit, and session start time settings.
Strengths
- Multi-symbol support for up to 9 instruments simultaneously, enabling risk diversification
- Bollinger Band width filter ensures trading only in low-volatility environments, aligning with night scalping logic
- New bar check prevents duplicate entries and reduces overtrading
- Independent parameter sets per symbol offer high flexibility for optimization
- Time window control with automatic position closure outside trading hours
Weaknesses
- Stop loss far exceeds take profit (e.g. Symbol1: 370 vs 20 points), resulting in extremely poor risk-reward ratio
- No spread filter, which is critical since nighttime low-liquidity sessions often have wide spreads leading to unfavorable fills
- Fixed lot size with no money management, position size does not adapt to account equity
- BBHandle indicator handle is recreated on every SymbolTrade call, causing resource/memory leak
- Time logic is flawed: only checks if current time > Start for entries with no end time, and closes only when time < Start which means closures happen in the pre-Start hours of a new day
- CloseAll function iterates positions and closes by symbol, but PositionClose may alter position indices causing skipped closures
- No Magic Number filtering, so it may conflict with other EAs running on the same symbol
Possible improvements
- Add a spread filter to prevent opening positions when spread exceeds a threshold, avoiding unfavorable fills during nighttime low liquidity
- Pre-create and cache all indicator handles in OnInit instead of recreating them on every SymbolTrade call to prevent resource leaks
- Add an end time parameter and implement proper time window logic to replace the flawed single-direction time check
- Add Magic Number support to distinguish this EA's positions from other EAs running on the same symbols
- Implement dynamic position sizing based on account equity or ATR for better risk management
- Fix CloseAll function to properly handle position index changes after closing, using reverse iteration with re-checking of PositionsTotal
Risk assessment
Overall risk: Caution
- Stop loss far exceeds take profit, requiring extremely high win rate to be profitable; one loss can wipe out many wins
- No spread filter for night trading may result in entries during wide spreads causing additional losses
- Indicator handle leak may exhaust terminal resources over time
- CloseAll function may skip positions due to index shifting, leaving unintended overnight positions
- No Magic Number may cause accidental closure of other EAs' positions or miscounting of open positions
- Fixed lot size with no money management wastes opportunity on large accounts and over-risks small accounts
Evaluation scores
Parameters
| Parameter | Default | Description |
|---|---|---|
Symbol1 | USDCAD | Symbol 1 name |
StopLoss1 | 370 | Symbol 1 stop loss in points |
TakeProfit1 | 20 | Symbol 1 take profit in points |
BBPeriod1 | 40 | Symbol 1 Bollinger Bands period |
BBDev1 | 1 | Symbol 1 Bollinger Bands deviation |
Razmah1 | 450 | Symbol 1 Bollinger Bands width threshold in points |
Start1 | 19 | Symbol 1 trading start hour |
Symbol2 | GBPUSD | Symbol 2 name |
StopLoss2 | 450 | Symbol 2 stop loss in points |
TakeProfit2 | 80 | Symbol 2 take profit in points |
BBPeriod2 | 8 | Symbol 2 Bollinger Bands period |
BBDev2 | 1 | Symbol 2 Bollinger Bands deviation |
Razmah2 | 200 | Symbol 2 Bollinger Bands width threshold in points |
Start2 | 20 | Symbol 2 trading start hour |
Symbol3 | NZDUSD | Symbol 3 name |
StopLoss3 | 410 | Symbol 3 stop loss in points |
TakeProfit3 | 40 | Symbol 3 take profit in points |
BBPeriod3 | 4 | Symbol 3 Bollinger Bands period |
BBDev3 | 1.2 | Symbol 3 Bollinger Bands deviation |
Razmah3 | 450 | Symbol 3 Bollinger Bands width threshold (points) |
Start3 | 19 | Symbol 3 trading start hour |
Lot | 1 | Trade lot size |
Similar Scalping EAs
Backtests are historical simulations and do not guarantee future results. Not financial advice.