Prior Day Breakout Pro
- Experts
-
Allan Aparece Ninal
Sviluppo indicatori ed Expert Advisor per MetaTrader 5.
Come lavoro:
- Ogni indicatore viene controllato contro il repainting: i segnali vengono decisi solo su barre chiuse, e un test su ogni tick conferma che non cambiano in seguito. - Versione: 1.3
- Aggiornato: 28 novembre 2026
- Attivazioni: 10
Prior Day Breakout Pro is an Expert Advisor for MetaTrader 5 that trades the previous-day high and low breakout on XAUEUR. It sizes each trade by a fixed lot or a risk percent, and it can pause around high-impact news. It decides on closed bars and sets a stop and a target on every trade. Run the free demo in the Strategy Tester on your own symbol before you decide.
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.
Standalone: Everything is built in. You do not need to buy or install any other product named on this page. The Prop Rules Guard lock is optional and only applies if you also run that tool.
In plain words
During a trading day, gold moves inside a range. Yesterday's high and low mark the edges of the previous day's range. A close beyond one of those edges can mean price is leaving the range.
This EA waits for that close. When a bar closes above yesterday's high, it buys. When a bar closes below yesterday's low, it sells. It enters at the next open.
The stop loss is the other side of yesterday's range. The take profit is a multiple of the stop distance, called R. At 23:00 server time the EA closes any open trade.
The rule is simple, and it was tested on 37 symbols. It passed on XAUEUR only. That makes the result narrow: it is not a general method for every market.
What it does, step by step
- When a new bar opens, the EA reads the bar that just closed. It never decides on the forming bar.
- It takes yesterday's high and low from 1-minute bars of the latest earlier trading day.
- 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.
- It checks that a new entry is allowed: market open, no position of its own open, and the stop at least eight times the spread. It also checks your filters: news window, spread limit, Friday cut-off and the Prop Rules Guard lock.
- It sends a market order at the next open: buy at the ask, sell at the bid. The stop is the other side of yesterday's range. The target is the preset's multiple of the stop distance.
- It closes the trade at 23:00 server time if neither stop nor target was hit. If the market is closed then, it closes at the first tick after it reopens.
It holds one position at a time. With break-even on, it can move the stop to the entry once the trade is at a profit of x R. It never adds to a trade and never averages down.
Worked example
XAUEUR H1, 0.01 lot, 2R target, from the tester trade list behind the validated H1 preset (broker history, bar open times in server time). Prices are in the symbol's own units.
| Entry bar opens | Side | Entry | Stop | Exit | Exit time | How it ended | Result in R |
|---|---|---|---|---|---|---|---|
| 2023-07-03 16:00 | buy | 1761.88 | 1750.32 | 1761.12 | 23:00 | 23:00 close | -0.07 |
| 2023-10-13 08:00 | buy | 1778.66 | 1764.2 | 1807.58 | 15:26 | target hit | 2.00 |
The first trade bought at 1761.88. The stop, yesterday's low, was 1750.32, so one R was 11.56. The 2R target was 1785.00. Neither was hit, so the EA closed the trade at 23:00 at 1761.12, a result of -0.07 R.
The second trade bought at 1778.66 with the stop at 1764.2. One R was 14.46, and the target was 1807.58. Price reached it the same day.
Most trades end at the 23:00 close and not at the target. In this run the H1 preset made 612 trades. Of these, 516 ended at the 23:00 close, 36 at the stop and 3 at the target. 53 ended at the first tick after the market reopened, and 4 ended in other ways.
Key facts
| Type | Expert Advisor for MetaTrader 5. It opens and closes its own trades. |
| Symbols and timeframes tested | XAUEUR H1 and M15 (six presets: each with news off, pause and pause + flat). 37 symbols were screened; only XAUEUR passed. Other symbols have no testing behind them. |
| Lot size | Fixed lot (default 0.01) or a risk percent of balance (default 1.0%), never below the broker minimum. If even the minimum lot risks more than asked, the EA skips a live trade. |
| Stop and target | Every trade has both. Stop: the other side of yesterday's range. Target: the preset's multiple of that distance (2R on H1, 1R on M15). Exit at 23:00 server time at the latest. |
| When a signal is final | When its bar closes. The EA decides on closed bars only, and a signal never changes afterwards. |
| Restart, reload and timeframe change | The EA replays today's closed bars. A side that already fired today is not taken again. An open trade keeps its stop and target. |
| Alerts | Off by default. In dry run, each signal arrives as a pop-up alert with sound, a push notification, or both, and no trade opens. |
| Trades | Yes, by default. Set dry run to true to receive signals only. |
| Other products needed | None. |
| Test results | Strategy Tester results are not live results. See How it was checked. |
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) and News mode to one of the six presets in the table below. The Preset row on the panel then reads validated.
- Choose the size: Fixed lot (default 0.01) or Risk % of balance (default 1.0). The Lot row on the panel shows the choice.
- Leave the filters off to run the rule as tested, or add a spread limit, a Friday cut-off or break-even.
Account
- Minimum balance: 1,500 USD at 0.01 lot.
- Recommended balance: 3,000 USD at 0.01 lot.
- Why: the out-of-sample backtest at 0.01 lot had a largest drawdown of 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.
- Risk-% sizing: with 1% risk, use 5,000 USD or more. On a smaller balance the minimum lot can risk more than 1%. Live, the EA then skips the trade and does not raise the lot.
Who it is for
For traders who want the previous-day high and low breakout on XAUEUR with risk-percent sizing and news modes. They accept that it was tested on gold only.
Not for you if you want a method proven on many markets, or live results. Every result on this page is a backtest, not a promise.
How it works under the hood
The rule
- Levels: the high and low of the previous trading day, taken from 1-minute bars of the latest earlier server day, up to 7 days back.
- Signal: the first close of a bar above the high (buy) or below the low (sell). The bar must open from 01:00 to 20:00 server time. Each side fires once per day.
- Entry: a market order at the open of the next bar. It is skipped if the stop is under eight times the spread.
- Stop and target: the other side of yesterday's range, and the target multiple of that distance.
- Exit: flat at 23:00 server time. One position at a time.
The EA also refuses a trade whose stop would lose more than 50% of equity, or when free margin is not enough. It runs an order check before each market order and skips an order the broker would refuse.
What Pro adds
- Lot sizing: fixed lot, or a risk percent of balance lost if the stop is hit, never below the broker minimum. The EA skips a live trade if even the minimum lot risks more than asked.
- News modes: off, pause or pause + flat.
- Filters: maximum spread in points, and no new trades on Friday from a chosen hour.
- Break-even: moves the stop to the entry, plus optional points, at a profit of x R.
- Prop Rules Guard lock: no new trades while the lock is set. It is on by default.
News modes
Off by default, so the rule runs as tested. Pause blocks new entries from 30 minutes before to 30 minutes after a high-impact release. Pause + flat also closes an open trade 5 minutes before the release.
The backtests used a built-in list of 556 high-impact USD releases from 2020 to 2026. It covers NFP, CPI, PPI, retail sales, PCE, GDP advance and FOMC. The list was applied to XAUEUR as is.
Live, the EA reads the MetaTrader economic calendar. It takes high-importance events for USD and for the symbol's own currencies, such as EUR. That is more events than the backtest list, so live the filter is not identical to the tested one. In the backtests the news modes changed results only slightly.
Inputs
| Input | Default |
|---|---|
| Target, x the stop distance (R); news mode | 2.0 (1.0 on M15); Off |
| Magic number; maximum slippage, points | 26101801; 30 |
| Sizing; fixed lot; risk percent of balance | Fixed lot; 0.01; 1.0 |
| Break-even at x R; points beyond the entry | 0 (off); 0 |
| Maximum spread, points; no new trades on Friday from this hour | 0 (off); 0 (off) |
| Refuse new trades while Prop Rules Guard is locked; allow live trading outside the validated presets | true; true |
| 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 |
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 | News mode | Target | Out-of-sample trades | Profit factor |
|---|---|---|---|---|
| XAUEUR H1 | off | 2R | 612 | 1.37 |
| XAUEUR H1 | pause | 2R | 609 | 1.36 |
| XAUEUR H1 | pause + flat | 1R | 609 | 1.38 |
| XAUEUR M15 | off | 1R | 690 | 1.27 |
| XAUEUR M15 | pause | 1R | 677 | 1.24 |
| XAUEUR M15 | pause + flat | 1R | 677 | 1.25 |
Backtest, not live trading: broker history, 1 July 2023 to 8 October 2026, 0.01 lot, spread and swap included, no commission. Each preset passed the Python backtest and the MetaTrader 5 Strategy Tester. Each has its own setting, 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 six rows are one idea in six forms, and they share most trades. Commission was not modelled.
Use and limits
- By default the EA trades on any symbol, timeframe, target and news mode. Only the six presets passed my tests. Anything else shows not validated on the panel and has no testing behind it. Turn off the input "Allow live trading outside the validated presets" to trade only the presets. 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.
How to test in the Strategy Tester
- Open the Strategy Tester (Ctrl+R, or View > Strategy Tester).
- Choose Prior Day Breakout Pro 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 |
| XAUEUR H1, pause | News mode = Pause: no entry 30 min before to 30 min after a release |
| XAUEUR H1, pause + flat | Target, x the stop distance (R) = 1 (the preset's own value). News mode = Pause + flat: also close 5 min before a release |
| XAUEUR M15, pause | Target, x the stop distance (R) = 1 (the preset's own value). News mode = Pause: no entry 30 min before to 30 min after a release |
| XAUEUR M15, pause + flat | Target, x the stop distance (R) = 1 (the preset's own value). News mode = Pause + flat: also close 5 min before a release |
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.
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. The message gives 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 and copy its MetaQuotes ID. 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.
How it was checked
- Code check: this EA ran in the Strategy Tester on all six presets. All 612, 609, 609, 690, 677 and 677 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.
Not tested: live trading. The tests do not model slippage, requotes or commission, and no live-account result is claimed.
Limits
- It was tested on XAUEUR only. Other symbols and timeframes have no testing behind them.
- Most of the tested gain came from buys in a period when gold rose strongly. A different period can look different.
- The stop can be wide. In the out-of-sample test the widest stop was about 710 USD at 0.01 lot.
- Tester results are not live results. Spread, slippage and your broker's gold feed can change the outcome.
- The 01:00 to 20:00 window and the 23:00 exit follow your broker's server clock.
- It needs the terminal running. A VPS keeps it running.
FAQ
Does it repaint? No. It decides on closed bars only.
Why no trade today? The close must break yesterday's high or low during the session, once per side. A news window, spread limit or lock can also block it. The panel shows the reason.
What happens if I restart the terminal or change the timeframe? The EA replays today's closed bars. A side that already fired today is not taken again.
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.
Which news mode should I use? Off is the rule as tested. The other two are options, not improvements.
Can I get signals without trades? Yes. Set the dry run input to true.
How do I report a problem? Turn on the debug log, repeat it, and send the DBG lines with your inputs and a screenshot.
Try it first
Run the free demo in the Strategy Tester on your own symbol before you decide. For the same rule with a fixed 0.01 lot and no news modes, the free edition is Prior Day Breakout. Test any EA on a demo account before you use real money.
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. |
| Prop Rules Guard MT5 | Put the Guard on one chart of the prop account and set the firm preset. Leave "Prop Rules Guard lock" on (default on). | The EA reads the Guard's lock and stops opening trades while it is locked. This is read from the code; the two were not run together live. |
| 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. |
Free and Pro: Prior Day Breakout and this EA share the default magic number 26101801. Do not run both on the same symbol and timeframe.
XAUEUR is a gold market. Running it with other gold EAs adds to the same exposure.
Related products
- Prior Day Breakout: the same rule with a fixed 0.01 lot and no news modes, for the two news-off presets.
- Breakout Atlas: a separate EA with three breakout models and its own XAUEUR H1 preset. Both often trade the same direction on the same day. If you run both, keep their magic numbers different and count their risk together.
- Prior Day Breakout Pro MT4: the same Expert Advisor for MetaTrader 4.
- All my products on MQL5
Custom work
Want an indicator for this EA, a custom version of it, several of my indicators or EAs combined into one, an EA that trades another indicator you use (mine or another developer's), 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.
Found a problem?
- 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 you find it useful, 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.
