Skip to content

Free MT5 Expert Advisor

Previous Day Breakout EA

MT5 Expert Advisor that trades the first close beyond the previous day's high or low, with an ATR stop and a daily trade limit.

Breakoutv1.0MetaTrader 5 (MQL5) Compiles with 0 errors Non-repainting signals Stop-loss on every trade
Strategy
Buys the first intraday candle that closes above the previous day's high and sells the first that closes below the previous day's low, up to a daily trade limit.
Risk model
1% of balance per trade (configurable), ATR stop-loss on every order, one position per symbol and magic number, one trade per day by default

What it does

The previous day's high and low are among the most watched intraday levels. Previous Day Breakout EA trades a close beyond either of them, on the idea that a break of yesterday's range can start a directional move. A daily limit stops it from trading the same level over and over when price chops around it.

How it works

On each new intraday bar, for the last closed candle of the current day:

  1. Levels: the high and low of the completed previous daily candle.
  2. Buy: the candle closes above the previous-day high (plus the buffer), and the candle before it did not.
  3. Sell: the candle closes below the previous-day low (minus the buffer), and the candle before it did not.
  4. The EA counts its own entries since the start of the server day; once the limit is reached, further breaks are skipped with a message.
  5. The stop is 1.5 ATR from entry. With "stop beyond level" on, it is moved further if needed so it sits at least 0.5 ATR back inside the broken level. The target is 2 R.

Entries are only taken in the trading-hours window (8 to 18 server time by default), which avoids the thin hours around the daily rollover.

How to use it

Use M15 to H1 charts. Breakouts tend to be more reliable when the previous day was narrow and the break comes during an active session. A small break buffer reduces trades on marginal closes. If you raise the daily limit, the EA can trade the opposite side later the same day, but never two positions at once.

Settings

InputDefaultWhat it changes
Max trades per day1Daily entry limit
Break buffer (points)0How far the close must clear the level
Stop distance (x ATR)1.5Stop-loss size
Stop beyond leveltrueMinimum stop room inside the level
Draw levelstrueShows the previous-day high and low
Risk % / Fixed lots1.0 / 0Position sizing
Take-profit (R)2.0Target distance (0 = none)
Max spread (points)30Spread filter
Trading hours8 to 18Entry window (server time)
Break-even / Trailingon at 1 R / offTrade management

Limitations

False breakouts are common: price closes beyond the level and then returns into the range. The daily candle depends on the broker's server time, so levels vary between brokers. Entries come at the candle close, often after a large part of the breakout move. Gaps at the weekly open can place price beyond the level before the first candle closes.

Before you run it live

Test the EA in the Strategy Tester across quiet and volatile months and then on a demo account. Check how your broker defines the trading day. Start with a small risk percentage and review risk management basics first. Trading carries a substantial risk of loss.

Key inputs

Key inputs of Previous Day Breakout EA
InputDefaultDescription
Max trades per day1Entries allowed per server day.
Break buffer (points)0The close must clear the level by this many points.
Stop distance (x ATR)1.5Stop-loss distance from entry.
Stop beyond leveltrueKeeps the stop at least 0.5 ATR back inside the broken level.
Trading hours8 to 18Server-time window for new entries.
Risk per trade (%)1.0Share of balance risked between entry and stop-loss.

Educational tools, not advice. Automated trading can lose money quickly. Indicators and Expert Advisors describe price; they do not predict it, and past behaviour does not guarantee future results. Test everything on a demo account first and never risk money you cannot afford to lose. See our disclaimer.

Keep exploring

Related mt5 expert advisors