SR Breakout EA
- Experts
- Themichl LLC
- Versione: 1.10
- Attivazioni: 5
SR Breakout EA is a fully automated Expert Advisor for MetaTrader 5 that trades genuine support and resistance breakouts on any symbol and timeframe. It identifies the most recent swing high and swing low over a configurable lookback window, confirms the breakout with momentum and impulse filters, and enters in the direction of the breakout once price has cleared the level by a measurable distance.
The EA is designed for serious live use. It works on netting and hedging accounts without configuration changes, respects every broker constraint reported by the symbol specification, and was hardened against the validation rules of the MQL5 Market.
How it trades
A breakout is registered only when price closes beyond the level by a configurable point distance and at least one of two confirmation conditions is met: three consecutive closes in the breakout direction, or a strong-impulse move that exceeds a separate stronger threshold. The same level is not retraded until either a minimum price gap or a minimum time window has elapsed, which prevents repeated entries on the same exhausted move.
Risk and trade management
Stop loss and take profit are derived from ATR with independent multipliers for SL and TP, so the reward-to-risk ratio adapts to current volatility rather than to a fixed point distance. Once a trade is open, three independent managers can be enabled or disabled:
- Trailing stop that follows price by a configurable distance once a minimum profit is reached.
- Breakeven shift that locks in zero loss after a configurable profit threshold.
- Profit trailing on the take profit leg that extends the target while the trade keeps moving in your favor.
All position modifications go through a single safe wrapper that skips no-change requests, respects the broker freeze level on both the current and the requested SL or TP, and never sends a modify the broker would reject.
Broker-safe execution
Every order send and every position modification is pre-validated. The EA normalizes lot size to the broker volume step, respects SYMBOL_VOLUME_LIMIT, checks free margin with OrderCalcMargin, validates SL and TP against SYMBOL_TRADE_STOPS_LEVEL, applies a directional freeze-level check based on SYMBOL_TRADE_FREEZE_LEVEL, and runs OrderCheck before sending. A session and tick-freshness gate prevents sends during the symbol daily break, which is the usual cause of Market closed errors on instruments such as gold and indices. Filling mode is auto-detected as FOK, IOC, or Return based on the symbol.
On netting accounts the EA closes any opposite position before opening a new one and never relies on implicit reversal, which avoids the close to market rejections common when SL or TP sits inside the freeze band.
Inputs
- Symbol and timeframe: any. Tested on EURUSD, USDJPY, USDCAD, NZDUSD, XAUUSD on M30, H1, H4, H12, D1, W1.
- Level lookback bars
- Breakout points and strong breakout points
- Minimum level gap and minimum time between trades on the same level
- ATR period, SL multiplier, TP multiplier
- Trailing distance and minimum profit to start trailing
- Breakeven trigger
- Profit-trailing distance for the take profit
- Lot size and magic number
Recommended use
Start on a demo account on H1 with default inputs. The EA opens at most one position per symbol and is safe to run on multiple symbols in parallel by assigning each chart a different magic number.
Support is provided through the product comments section on mql5.com.
