The first 30 minutes after the open on Gold (XAUUSD) set a high and a low, and this EA trades the first candle that closes outside them. It reads the range once the window is over, from 10:00 server time by default, and then waits up to 180 minutes for a close above the high or below the low. A wick through the level is not enough, the candle has to close beyond it.
One market position per day by default. The stop goes on the other side of the range, or in the middle if you prefer, the target is 1.5 times the stop distance and the lot is sized to risk 1 percent of the balance. Whatever is still open at 22:00 server time is closed, so nothing stays overnight.
Ranges that are too tight or too wide can be skipped with a minimum and maximum height in points. A breakout can fail and come back into the range, so test the session time and the target on your broker before going live.

Any symbol. Use a timeframe equal to or lower than the range length, M1 to M30 for a 30 minute range. On a higher timeframe it writes a message in the log and does not trade. Times are broker server time, so set them for your broker: 10:00 is the London open on a GMT+2 server and 16:30 the New York stock open. Decisions are made on closed candles only. It manages only positions with its own magic number on the chart symbol and checks the free margin before every order. Netting and hedging accounts both work, since it holds one position at a time.
Run your own backtests on XAUUSD, XAGUSD, EURUSD, GBPUSD, US30 or NAS100 and compare a 15, 30 and 60 minute range, M5 against M15, and a target of 1.0, 1.5 and 2.0. XP_OnNewBar holds the whole decision, so it is the place to add a trend filter, a news pause, Smart Money Concepts structure or a second session. XP_Lot, XP_MarginOk and XP_CloseAll are ready to copy into your own EA. If you only want the range drawn, the free Opening Range Breakout Box indicator does that.
Open source. Use it as it is, adapt it, build your own version on top of it. New versions and new tools are announced first on my MQL5 channel: https://www.mql5.com/en/channels/xander. Questions, suggestions and your own backtests are welcome in the Xander Lab group: https://www.mql5.com/en/messages/02eec85e4364dd01. More tools on my profile: https://www.mql5.com/en/users/09151993a. Provided as is, use at your own risk.
Related: Opening Range Breakout Box, Supertrend EA Gold Breakeven, Risk Lot Size Calculator Panel, Forex Session Boxes.
v1.0 (2026-11-20): initial release.
Spectar Prop Challenge Dashboard
Read-only panel with the numbers a prop-style challenge is judged on: today's result from server midnight (closed plus floating), room to your daily loss limit, static or trailing overall floor, profit target and trading days.
PassRecorder
A library for MetaTrader 5 that writes every pass of an optimization to a SQLite file: result, test statistics, your own metrics and the inputs of the pass. A demo Expert Advisor optimizes the Rosenbrock function in the mode "Math calculations".
Premium Discount OTE Zones
Premium and discount zones for MT5 on Gold (XAUUSD), forex and indices: dealing range from confirmed swings, equilibrium 50 percent, 25 and 75 percent lines and the OTE band of the last leg. Open source code.
Daily Loss and Profit Lock
Daily loss limit EA for MT5 on prop firm and funded accounts, Gold (XAUUSD), forex and indices: closes every position at the daily loss or profit limit, deletes pending orders and locks trading until the next day. Open source code.