Prior Day Breakout
- 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.0
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
| 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
- Live, the EA trades only these two presets. On another symbol, timeframe or target it shows not validated and sends no orders. 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.
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 |
| Log every signal and trade (Experts tab) | false |
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 Pro: the same rule with risk-based sizing, news modes, spread and Friday filters.
- 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? Not live. It was tested there and did not pass, so it sends no orders.
How do I report a problem? Turn on the debug log, repeat it, and send the DBG lines with your inputs and a screenshot.
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.
