Prior Day Breakout
- Uzmanlar
- Sürüm: 1.3
- Güncellendi: 28 Kasım 2026
Prior Day Breakout is an Expert Advisor for MetaTrader 5 that trades the previous-day high and low breakout on XAUEUR. It uses a fixed 0.01 lot and decides on closed bars. Two presets are included, for H1 and M15.
This EA promises no profit. Every result below is a backtest on broker history, not live trading. The tests passed on gold only. Thirty-seven symbols were tested.
Quick start
- Open an XAUEUR chart on H1 or M15 (a prefixed or suffixed name is fine). Attach the EA from the Navigator and keep Algo Trading enabled.
- Set Target (R) to the preset: 2.0 on H1, 1.0 on M15. The Preset row on the panel then reads validated.
- Leave the other inputs as they are. The lot is fixed at 0.01, or the broker minimum if that is larger.
- Keep the terminal running, or use a VPS. The EA acts on the first tick of each new bar.
Account
- Minimum balance: 1,500 USD at 0.01 lot.
- Recommended balance: 3,000 USD at 0.01 lot.
- Why: in the out-of-sample backtest at 0.01 lot, the largest drawdown was 673 USD, the largest single loss was 373 USD, and the widest stop was about 710 USD. These are backtest figures, not a limit on future losses.
- Leverage: 1:100 or higher. Hedging or netting account.
- Standalone: Everything is built in. You do not need to buy or install any other product named on this page.
What you see on the chart
- Panel: rule, chart, target, preset status, previous-day high and low, last signal, open position and lot.
- Levels: yesterday's high and low, drawn as dotted lines across the current day.
The rule in brief
On each new bar the EA reads the bar that just closed. The levels are the high and low of the previous trading day, taken from 1-minute bars. A buy needs a close above the high. A sell needs a close below the low.
Only bars that open between 01:00 and 20:00 server time count. Each side can fire once per day. The EA then sends a market order at the next open.
The stop is the other side of yesterday's range. The target is the preset's multiple of that stop distance, called R. Any open trade is closed at 23:00 server time. There is one position at a time. A trade is skipped if its stop is under eight times the spread.
Validated presets
The default inputs are the XAUEUR H1 preset: 2R target, news off. Attach the EA to an XAUEUR H1 chart and keep the defaults to use it.
| Symbol and timeframe | Target | Out-of-sample trades | Profit factor |
|---|---|---|---|
| XAUEUR H1 | 2R | 612 | 1.37 |
| XAUEUR M15 | 1R | 690 | 1.27 |
Backtest, not live trading: broker history, 1 July 2023 to 8 October 2026, 0.01 lot, spread and swap included, no commission. Both presets passed the Python backtest and the MetaTrader 5 Strategy Tester. The settings were frozen on 2020 to mid-2023 data before the later period was opened.
Read the numbers with care. Of 37 symbols tested with this rule, only XAUEUR passed. XAUUSD came close but stayed below the bar. Most of the gain came from buys in a period when gold rose strongly. The two timeframes share many trades. Commission was not modelled.
How it was checked
- Code check: this EA ran in the Strategy Tester on both presets. All 612 and 690 trades matched the Python model in time, side and exit.
- Closed bars only: signals do not change after a bar closes, so there is no repaint.
- Tester data: 1-minute OHLC prices from broker history. Slippage and requotes are not modelled.
Use and limits
- By default the EA trades on any symbol, timeframe and target. Only these two presets passed my tests. Anything else shows not validated on the panel and has no testing behind it. The Strategy Tester accepts any symbol.
- The tests used a server clock of UTC+2, or UTC+3 in US summer time. The 01:00 to 20:00 window follows your server clock, so check that it matches.
- If the market is closed at 23:00, the trade closes at the first tick after it reopens.
- XAUEUR is offered by few brokers. Check that yours lists it.
Automatic trading or signals only
By default the EA trades automatically: it opens the trade when its rule fires and manages it. If you would rather decide yourself, set "Dry run: alert each signal, open no trades" to true. The EA then opens nothing. Each signal it would have traded arrives as a pop-up alert with sound, a push notification on your phone, or both: direction, price, stop loss, take profit and lot. You review it and decide whether to enter by hand.
- Dry run is off by default. Nothing changes until you turn it on.
- "Dry run: pop-up alert with sound" and "Dry run: push to phone" are on by default and only work while Dry run is on. Turn one off to keep the other.
- Push to your phone: install the MetaTrader mobile app, copy its MetaQuotes ID and enter it in the terminal under Tools > Options > Notifications, then enable push notifications.
- In dry run the EA opens, closes and changes no trade, including trades you open by hand. The Strategy Tester only writes the signals to the log.
- Each signal is sent once. This is a tool for your own decisions, not advice, and no profit is promised.
Inputs
| Input | Default |
|---|---|
| Target, x the stop distance (R) | 2.0 (1.0 on M15) |
| Magic number; maximum slippage, points | 26101801; 30 |
| Show the panel; draw the previous-day high and low | true; true |
| Dry run: alert each signal, open no trades | false |
| Dry run: pop-up alert with sound | true |
| Dry run: push to phone | true |
| Debug log for bug reports | false |
How to test in the Strategy Tester
- Open the Strategy Tester (Ctrl+R, or View > Strategy Tester).
- Choose Prior Day Breakout as the Expert Advisor.
- Set Symbol and Timeframe to those of the preset you want to test.
- Set the model to "1 minute OHLC", the model my tests used.
- Choose a date range, for example 2023.07.01 to 2026.10.01.
- Use a deposit and leverage close to your own account.
- Open the Inputs tab, make the changes below, and start the test.
| Preset | Inputs to change from the defaults |
|---|---|
| XAUEUR H1, news off | None |
| XAUEUR M15, news off | Target, x the stop distance (R); the preset's own value = 1 |
The default inputs already are the XAUEUR H1 (2R target, news off) preset, so that one needs no changes.
You can try other settings the same way. The tester ignores any live-only option, and a test of other settings is not a validated preset. A backtest describes the past only.
Works well with
These are workflow suggestions. I have not found that any pair gives better trading results. You do not need any of them.
| Product | How to use them together | Why |
|---|---|---|
| Session Levels | Add it to the same chart. | It draws the previous-day high and low that the EA trades. The EA also draws its own dotted lines, so the indicator is optional. |
| EA Health Monitor | Give the EA its own magic number in its inputs. Attach the monitor to one chart of the account. | It shows one row per magic number, so you can read this EA's trades on their own. |
| Prop Rules Monitor | Attach it to one chart of the account while the EA runs. | It shows your distance to a prop firm's limits. It only watches and never closes anything. |
XAUEUR is a gold market. Running it with other gold EAs adds to the same exposure.
Related products
- Session Levels: a free indicator that draws the previous-day high and low, session boxes and alerts. It places no trades.
- Prior Day Breakout MT4: the same Expert Advisor for MetaTrader 4.
- All my products on MQL5
FAQ
Repaint? No, closed bars only.
Why no trade today? The close must break yesterday's high or low during the session, once per side. The panel shows the levels and the last signal.
Does it work on XAUUSD? It trades there by default, but it was tested there and did not pass, so it is not a validated preset.
How do I report a problem? Turn on the debug log, repeat it, and send the DBG lines with your inputs and a screenshot.
Custom work
Want an indicator for this EA, a custom version of it, or a new indicator or EA of your own? Order it through MQL5 Freelance and choose me as the developer: order through Freelance. Send your requirements, rules and the flow or algorithm you want. The whole order, payment and delivery stay inside MQL5 Freelance.
Reporting a bug or error
- In the inputs, set "Debug log for bug reports" to true.
- Leave the EA running until the problem happens.
- Open the Experts tab in the Toolbox, select the lines that start with "DBG", right-click and choose Copy (or choose Open to get the log folder).
- Send them as a comment on this product page, with the symbol, timeframe, EA version and what you expected to happen.
The debug log never contains your login, name, server, balance or equity. Set it back to false afterwards. I answer only through the comments on this page.
If it helps your trading, a short review on this page helps other traders find it.
Questions: use the comments on this page or send me a message on MQL5.
Trading carries a risk of loss, and past results do not predict future results.
