BandSnapPro
- Uzmanlar
-
Alex Amuyunzu Raymond
I’m an experienced MQL5 developer and software engineer specializing in building robust, high-performance algorithmic trading systems for MetaTrader 5. My work goes beyond standard EA development — I design intelligent, scalable solutions that combine market logic, automation, and external - Sürüm: 1.0
- Etkinleştirmeler: 5
BandSnapPro: Trade the Snap-Back. Disciplined Bollinger Reversal Execution with Built-In Risk Control
BandSnapPro is a rules-based Expert Advisor for MetaTrader 5 that trades one thing and does it with discipline: the return of price from an extreme back inside its Bollinger Bands. It does not guess tops and bottoms, and it does not enter while price is still stretching. It waits for a completed candle to close outside the band, then waits for the next completed candle to close back inside. Only after both confirmations does it act, at the first tick of the following candle.
Every decision is made on closed candles, so signals do not repaint and cannot change after the fact.
The Core Idea
When price closes outside a Bollinger Band, it is stretched relative to recent volatility. The first close outside is not a signal, because strong trends can keep walking along the band. The signal is the failure to stay outside: the next candle closes back inside the band. That is the snap-back this EA is built around.
Exact Entry Rules
- BUY: candle 2 closes below the lower Bollinger Band, and candle 1 closes back above the lower band. The EA enters at the first available tick of the new candle.
- SELL: candle 2 closes above the upper Bollinger Band, and candle 1 closes back below the upper band. The EA enters at the first available tick of the new candle.
- Each candle is evaluated once. A signal can never be processed twice.
Risk Management Built In
- Stop Loss is 1.5 x ATR (period 14) measured at the signal candle close, so the stop adapts to current volatility instead of using a fixed number of pips.
- Take Profit is 2 x the initial Stop Loss distance, a fixed 1:2 risk-to-reward structure.
- The lot size is fixed (0.01 by default), so exposure is predictable on every trade.
- There is no martingale, no grid and no averaging, and the EA never adds to a losing position.
- All multipliers, periods and the lot size are configurable.
Protection Filters
- Maximum spread filter (25 points by default): if the spread is too wide at the entry tick, the signal is skipped, not chased.
- One open position per symbol and magic number.
- Maximum two entries per day. The count is read from your deal history, so it stays correct after restarts.
- Late-entry guard: if the terminal is restarted mid-candle, the EA will not enter unless it is still within a short, configurable window after the candle open.
- Trading permissions are checked before every order: terminal algo trading, EA permission, account permission, and long-only or short-only symbol restrictions.
Restart and VPS Safe
The last processed candle is stored in a terminal global variable. After a terminal restart, a VPS reboot or a chart reload, BandSnapPro will not repeat a signal it has already handled.
Broker-Safe Execution
- Lot size is normalised to the broker’s minimum, maximum and step.
- Free margin is checked before sending an order.
- If the calculated stop is closer than the broker’s stop level, it is widened to a valid distance and logged.
- Prices are aligned to the symbol’s tick size.
- Filling mode is selected automatically for the symbol.
- On a requote or price change, the order is retried once with refreshed prices and re-checked spread.
- Works on hedging and netting accounts and needs no DLLs and no web requests.
Professional On-Chart Dashboard
BandSnapPro draws a clean dark panel directly on the chart, with no clutter:
- A status indicator showing Scanning, In Position, Spread High, Daily Limit or Trading Off.
- Balance, equity and floating P/L for the EA’s positions.
- A live market structure view: a mini chart of price against both Bollinger Bands, a zone label (inside, above upper, below lower), and a line telling you when a BUY or SELL setup is armed.
- A spread gauge against your maximum.
- ATR in pips, with the resulting SL and TP distances.
- Entries today against the daily limit, today’s P/L, and the 90-day win rate.
- The last signal event and server time.
Optional extras: a dark chart theme and the Bollinger Bands drawn on the chart. Both can be switched off, and the original chart colours are restored when the EA is removed.
Clear Execution Logs
Every step is written to the Experts journal: SIGNAL, SEND with price, SL, TP, ATR and spread, OK with deal and order numbers, and SKIP or FAILED with the exact reason. You can always see why a trade did or did not happen.
Inputs Overview
- Strategy: symbol (empty uses the chart symbol), signal timeframe (default M15), Bollinger period (20) and deviation (2.0).
- Risk: ATR period (14), SL multiplier (1.5), TP ratio (2.0), fixed lot (0.01), maximum spread (25 points), maximum entries per day (2).
- Execution: magic number, slippage, late-entry window, order comment.
- Dashboard: show or hide, position, chart theme, band display.
Recommended Setup
- Default configuration: EURUSD on M15.
- Run on a VPS for continuous operation.
- Test in the Strategy Tester with real ticks before using a live account, and choose settings that fit your broker’s spreads.
What BandSnapPro Is Not
It is not a martingale, grid or averaging system, it does not hide losses, and it does not promise returns. It is a transparent, single-strategy reversal EA with strict, visible rules. Mean-reversion strategies can suffer in strong trends, and past performance does not guarantee future results. Trading leveraged products carries significant risk.
Support
Questions or feature requests are welcome through the MQL5 messaging system. Updates will be released through the Market.
