Session Breakout Portfolio EA
- Uzmanlar
- Sürüm: 1.0
- Etkinleştirmeler: 10
Session Breakout Portfolio EA
A session-range breakout portfolio for indices, gold and forex, traded from one chart.
Every market has a quiet session and an active open. The EA builds the range in the quiet session (Asian range, pre-open or opening range), in the exchange's own time zone with automatic daylight saving, and trades the breakout at the active session open with OCO stop orders. One stop-protected trade per market per day. No grid, no martingale, no averaging.
Default portfolio (5 markets, 5 sessions)
- USTEC / NAS100 – New York 09:30–10:00 opening range, break-even at 1R, exit 15:55 New York
- DE40 / GER40 – Frankfurt 09:00–09:30 opening range, stop at half range, exit 17:25 Frankfurt
- JP225 – Tokyo 09:00–09:30 opening range, compression filter (range ≤ 0.4 daily ATR), exit 15:00 Tokyo
- XAUUSD / GOLD – New York 09:30–09:45 range with daily trend filter, exit 15:55 New York
- USDJPY – Asian range 00:00–07:00 London, breakout into the London session, break-even at 1R
Four more slots are included and fully configurable (US30, UK100, EURUSD, GBPUSD). They are disabled by default because their settings did not hold up in our out-of-sample test on IC Markets data – we prefer to tell you that rather than ship them switched on.
How it works
- Range: high/low of the quiet session window (M1 data), drawn on the chart.
- Range filters: minimum / maximum range size in multiples of the daily ATR(14), optional daily trend filter (prior close vs daily EMA), volatility regime filter (ATR5/ATR50), trading days.
- Entry: OCO buy stop above and sell stop below the range (or, optionally, a candle close beyond the range). When one side fills, the other is cancelled immediately.
- Exits: hard stop (fraction of the range, capped by ATR), optional R-multiple target, optional break-even, optional ATR trailing stop, and a session time exit.
- Exchange time with automatic DST: sessions are entered in New York, London, Frankfurt or Tokyo time. The EA converts them to your broker's server time (auto-detected, or GMT+2/+3, fixed or EU-DST modes) and handles the US/EU daylight saving gap weeks.
Portfolio risk engine
- Risk per trade as % of balance, % of equity, fixed money or fixed lots; min-lot protection.
- Total open-risk cap for the whole portfolio and a maximum number of positions.
- Correlation groups (US indices, EU indices, Asia indices, metals, USD pairs with USD direction): at most N same-direction positions per group.
- Prop-firm guards: daily loss limit, maximum drawdown (static or trailing; halts the EA), daily profit lock, close-all on a hard limit.
- Spread guard (spread as % of the stop), high-impact news filter (MT5 economic calendar, live).
- Free-margin check before every order, broker volume limits, stop/freeze levels and filling modes respected.
Dashboard
- One row per market: session in local time, today's range and its size in ATR, state (WAITING, BUILDING, ARMED, IN TRADE, DONE, FILTERED, BLOCKED) with the reason, today's P/L.
- Portfolio totals: positions, open risk vs cap, today's P/L %, drawdown.
- Pause / resume new entries, close-all (two-click confirm), click a market to open its chart.
- Dark and light themes, DPI scaling, movable, minimisable; docks at the right edge and shifts the chart so it never covers price.
Backtest (real ticks, IC Markets data, 2021-01 to 2026-10)
Default 5-market portfolio, 10 000 USD, 0.25% risk per trade, every tick based on real ticks:
Full period 2021-01 to 2026-10: net profit +51 704 USD, profit factor 1.20, 5 304 trades, maximum equity drawdown 8.4%, recovery factor 9.7.
In-sample 2021-01 to 2024-06: profit factor 1.27, 3 236 trades, maximum drawdown 12.3%.
Out-of-sample 2024-07 to 2026-10: profit factor 1.15, 2 066 trades, maximum drawdown 7.8%.
Each market alone was profitable in both periods (out-of-sample profit factor 1.11 to 1.22). IC Markets tick history starts in February 2025; for earlier dates the tester builds ticks from 1-minute bars. All inputs are visible; nothing is hidden.
Method: settings were chosen on 2021-01 to 2024-06 only (in-sample) and then tested on 2024-07 to 2026-10 (out-of-sample). Markets whose settings failed the out-of-sample test were switched off, so the out-of-sample figures of the final portfolio are somewhat optimistic. Backtest results are not a guarantee of future results.
Set-up
- Attach the EA to one chart (any symbol, any timeframe). Do not attach it to several charts.
- The default inputs are the recommended 5-market portfolio. For a prop-firm challenge set: risk 0.15%, max open risk 1%, daily loss limit 3.5%, max drawdown 8%. To trade one market only, switch the other markets off.
- Allow Algo Trading. Broker names are resolved automatically (suffixes such as .a, m, .cash, #; aliases such as NAS100, US100, GER40, DAX40, JPN225, GOLD) and printed in the Experts log.
- Hedging or netting account. Recommended: a broker with index CFDs, from 1 000 USD; 0.25% risk per trade by default.
Inputs (main)
- Portfolio: magic number, comment, entry mode, candle timeframe, broker server time mode.
- Risk: mode, risk %, money, lots, max lots, min-lot rule; open-risk cap, max positions, max per correlation group.
- Guards: daily loss %, max drawdown % and reference, initial balance, daily profit lock, close on guard.
- Filters: trading days, volatility regime, trend EMA, max spread, breakout buffer, late-entry limit, news filter.
- Exits: max stop in ATR, break-even lock, trailing start and distance.
- Markets 1–9: symbol, enabled, time zone, range start/end, entry deadline, exit time, stop (x range), target R, min/max range in ATR, trend filter, direction, break-even R.
The news filter uses the MT5 economic calendar, which is not available in the Strategy Tester. Trading involves risk; use money you can afford to lose and test on demo first.

