Advanced Range Breakout / User Guide
0 / 8 done
User guide · MT4 & MT5 · daily range and swing breakouts

Advanced Range Breakout.
You pick the range. It handles the break.

A box around a session, or around the last unbroken swing highs and lows. The EA places a buy stop above and a sell stop below, keeps the planned risk when the fill slips, closes by stop, target or time, and can guard a prop firm account. No martingale, no grid.

2modes · daily range / swing
2platforms · MT4/MT5
0martingale or grid
01 / Install

Install and first run

One chart, one symbol. The EA trades only the symbol of the chart it is on.

  1. 1Get it from the MQL5 Market (MT5 or MT4 listing below). After the purchase it shows up in MetaTrader under Navigator > Expert Advisors > Market.
  2. 2Open a chart of the symbol you want to trade. In daily range mode the chart timeframe does not change the levels: the EA builds the range from 1-minute candles. In swing mode the chart timeframe is the timeframe of the swings (or set Swing timeframe).
  3. 3Drag the EA onto the chart and allow Algo Trading. Go through the inputs with steps 02 to 04 before you press OK.
  4. 4Check the panel. The TODAY block shows the range window in market time and in your broker's server time. If the two look right, the hours are right.
  5. 5Demo first. Run it on a demo account, and in the Strategy Tester with real ticks, before real money.
The factory values are built for XAUUSD: daily range 04:00-10:00 London, orders deleted and positions closed at 17:00 London, 0.5% of the balance per trade. They are a starting template, not a tested profitable setting. Read step 05 before you put it on any other market.
02 / Modes

How it trades

Pick the levels in Breakout levels: a daily time range (the default) or swing highs and lows. Trading direction limits it to buys, sells, or both.

Daily time range (default)
  1. ·Between Range start and Range end (market time, start included, end excluded) it records the high and the low.
  2. ·At the range end it places a buy stop at the high and a sell stop at the low, plus the entry buffer if you set one.
  3. ·Stop loss: by default at the other side of the range (100% of the range). Take profit: none by default.
  4. ·At Delete pending orders at the order that did not fill is deleted. At Close positions at any open position is closed.
  5. ·Both orders stay live after one fills, so a day can trade both directions. Set One trade a day to true to delete the other order on the first fill.
  6. ·If the price is already beyond a level when the range ends, that side is not placed that day. The Experts tab says so.
InputFactory valueWhat it does
Time zone of the hours belowLondonThe clock of every hour in this group. See step 03.
Range start / Range end04:00 / 10:00The box. HH:MM in that time zone.
Min / Max range size0 / 0Skips days whose range is smaller or bigger than this multiple of the daily ATR. 0 = no limit.
Daily ATR period14Days of the ATR above, counted to the last closed day.
Entry buffer0Points beyond the high and the low for the entry.
Delete pending orders at17:00The unfilled order is removed.
Close positions attrue, 17:00Closes what is still open. Turn it off to leave it to the SL or TP.
One trade a dayfalseTrue = the first fill deletes the other order.
SL mode% of the range, 100Or points (200 by default in that mode).
TP modeNo TPOr a multiple of the SL distance (2.0 R by default in that mode), or points.
Swing highs and lows

This is the mode of the old version, with the same inputs and the same factory values. A swing high is a high with 5 lower candles on each side (Candles on each side) that has not been broken since; a swing low, the same the other way. The EA looks for them in the Last candles to scan (200). It places stop orders at those levels (or market entries), moves them to closer levels when new ones appear, and only trades inside the kill zones: London 07:00-12:00 and New York 13:00-16:00 by default, Asia off. Kill zone hours are in server time unless you change Time zone of the kill zone hours. SL and TP go in points (200 / 700), ATR %, ADR % or candles.

Swing mode is a tool, not a tested setting. The tight trailing stop of the old version looked very good in 1-minute OHLC tests and did not hold with real ticks: on USDJPY M15, January to October 2026, the best swing setting went from a profit factor of 1.47 in 1-minute OHLC to 0.69 with real ticks. If you use swing mode with a trailing stop, test it with real ticks.
Trade management (both modes)
  • Break even: moves the SL to the entry (plus a buffer in points) once the trade is at the chosen multiple of R. Off by default.
  • Partial close: closes a % of the volume at a multiple of R. Off by default.
  • Trailing stop: in points, ATR %, ADR % or candles, with its own trigger. Off by default.
03 / Time zones

Set the hours in market time

The question every range EA gets: "what hour do I put with my broker?" Here you put the market's hour and the EA does the conversion.

  1. 1In Time zone of the hours below choose the clock of the market you trade: New York, London, Frankfurt, Tokyo, UTC, or Server time if you prefer to type your broker's hours yourself.
  2. 2Type the range and the close hours in that clock. The EA converts them to your broker's server time every day, daylight saving changes included.
  3. 3Leave Server daylight saving rule on Detect automatically. It reads your broker's rule from the weekly FX open.
  4. 4Check TODAY in the panel: Window (local) is what you typed, Window (server) is the same window on your broker's clock.
Factory window (London)On Axi server timeWhen
04:00-10:0006:00-12:00Most of the year
04:00-10:0007:00-13:00The weeks when London and New York change their clocks on different dates: from the second to the last Sunday of March, and from the last Sunday of October to the first Sunday of November

Axi's server clock is New York time plus 7 hours: its day starts at 17:00 New York. Your broker may differ; the panel shows the result for yours.

If the Experts tab says "Server clock: detection did not conclude", the EA uses the two inputs of Server Clock (advanced): set the rule your broker follows (US, EU or no daylight saving) and its GMT offset in winter (2 by default, the usual one for brokers on the New York close).
04 / Risk

Risk per trade

R in this guide is what one trade loses if it hits its stop at the size the EA calculated.

Lot size modeUse it for
Risk % of the current balance (factory, 0.5)Your own account. The size follows the balance.
Risk % of a fixed initial account sizeA prop firm challenge: put the challenge size in Initial account size.
Fixed lot sizeTesting, or if you want the same lot every day whatever the range.

The minimum lot rule. When the calculated lot is below your broker's minimum, the EA trades the minimum lot, whatever it risks. The Experts tab line of that day says it, for example "minimum lot 0.01, risks 5.31 R". On gold, 0.01 lot with the factory window risked about $34 per trade on average in my tests: 3.4% of a $1,000 account. Whether your account is big enough is your call, and this is the number to look at.

Slippage. With Move SL and TP with the fill price on slippage on (factory), the SL and the TP move with the real fill price, so the trade keeps the risk you planned. What no EA can stop is the stop itself filling beyond its price in a fast market. On US30 at the cash open I measured stop exits of up to about 1.5 R.

Demo first, always. The point of the demo is not to see it win. It is to see a losing week on your own screen, at your size, before it is your money.
05 / Starting points

Starting windows by market

Where I would start my own tests on each market. These are not tested settings and not a forecast.

MarketWindow / close atTradesNetPFMax DD
XAUUSD
factory
04:00-10:00 London
17:00
559+18.4 R1.1112.9 R
USDJPY06:00-10:00 London
17:00
595+20.2 R1.1021.7 R
GBPUSD04:00-07:00 London
17:00
826+50.1 R1.1040.5 R
US3009:30-10:00 New York
15:45
633+33.7 R1.1520.5 R
DE4009:00-10:00 Frankfurt
17:15
664+25.5 R1.1125.0 R
EURUSDNone I would start from
(best: 04:00-08:00 London)
-+12.6 R1.0339.8 R

How these came out: Axi, M15 chart, 1-minute OHLC, 23 October 2024 to 23 October 2026, factory settings except the window (SL at the other side of the range, no TP, both orders, spread filter and holiday calendar on), with the risk at 0.5% of a fixed base so every trade is the same size in R. For XAUUSD and USDJPY the window was picked on 2019-2023 data; for the other four it is the best of 6 to 9 windows tested on these same two years.

  • USDJPY: positive over the two years, negative over the last 12 months (-10.5 R, profit factor 0.90).
  • GBPUSD: 5 of the 9 windows tested were positive. Every window that starts at 02:00 or 04:00 London and ends between 05:00 and 08:00 was positive. Every one that ends at 09:00 or later was negative.
  • US30: all 6 windows tested were positive. The opening-range windows (09:30 to 10:00, 10:30 or 11:00 New York) had a profit factor of 1.15 to 1.18 and the smallest drawdowns. The windows before the open, 1.06.
  • DE40: all 6 positive, profit factor 1.02 to 1.11. The best one is the first hour of Xetra.
  • EURUSD: 7 of the 9 windows tested were negative. In these two years a London range breakout did not work there.
Three things before you use any of them.
1. Most of these are the best of several windows on the same data. Outside that data the normal thing is that they do worse.
2. They were run in 1-minute OHLC, not real ticks. On indices the cash open is exactly where execution slips most: test US30 and DE40 with real ticks before using them.
3. Type the hours in the market's time with the time zone input, as in the table. The EA converts them to your broker's time.

Index symbol names change from broker to broker (on Axi they are DJ30.fs and DAX40.fs). If yours is not one of the names listed in step 06, set the holiday calendar by hand.

06 / Execution

Spread, holidays and the weekend

A breakout EA loses most of its money in a few bad fills. These inputs are there for those days.

InputFactory valueWhat it does
Hold orders back while the spread is blown outtrueNo new orders while the spread is at least 2x its 60-minute median. A level broken during a blowout is skipped for the day.
Blown out = spread at least this x the 60 min median2.0How wide counts as blown out.
Withdraw a pending order when the price is this x the median spread away3.0During a blowout, an order that close to the price is withdrawn, and placed again when the spread is normal.
Max spread0A hard cap in points. 0 = no cap.
Exchange holiday calendarAutoNo orders on exchange holidays, and an earlier close on early-close days.
Extra days offemptyYour own days without trading, server dates as YYYY.MM.DD;YYYY.MM.DD.
Close everything on Fridayfalse, 21:50Closes positions and orders on Friday at that server time.

Auto calendar picks NYSE when the symbol name contains US30, DJ30, DJI, US500, SPX, SP500, US100, NAS100, USTEC, NDX or US2000, and Eurex when it contains DE40, GER40, DAX, DE30 or GER30. Anything else gets no calendar. If your broker uses another name, choose NYSE or Eurex yourself. Without a calendar, on a short US session the close time can come after the market has shut and the position stays open overnight: 2 nights in my US30 tests from 2021 to 2026. With it, zero.

The spread filter helps, it is not magic: in my US30 tests for 2026 it cut the entries taken during a blown-out spread from 19 to 12.

07 / Prop firm

Prop firm protection

All off by default. Turn them on for a challenge or a funded account, with your firm's rules in front of you.

InputFactory valueWhat it does
Start of the trading dayMidnight PragueWhen the daily counters reset. Or midnight server time.
Daily loss limitDisabled, 4.5In % or in $. Closes ALL positions of the account and stops until the next day.
Daily loss % ofInitial balanceThe prop firm rule. Or the day's opening balance, if that is how your firm measures it.
Daily drawdown limitDisabled, 5.0% of the day's highest equity, or $. Closes ALL positions of the account.
Total loss limitDisabled, 9.0% of the base balance, or $. Closes ALL positions and stops for good.
Initial balance0The base of the total loss and the daily loss %. 0 = the balance when the EA first starts. Set the challenge size if the account already moved.
Max trades / Max losing trades per day0 / 0Of this EA. 0 = no limit.
  • The limits act on the whole account, manual trades and other EAs included, because that is what the firm measures. Every ARB chart on the account sees the same stop.
  • Risk budget: with a daily or total loss limit on, each new order is sized to what is left before the tighter limit. If not even the minimum lot fits, the order is not placed, and the Experts tab says why.
  • For the lot size, use Risk % of a fixed initial account size with the challenge size (step 04).
Why 4.5 and 9 and not 5 and 10: a stop can fill beyond its price. In my US30 tests with real ticks for 2026, at 3% per trade and a 4.5% daily limit, 2 of 212 days still ended past 5% because of fills beyond the stop. Keep a margin under your firm's line and a sane risk per trade.
08 / Panel

Read the panel

The header shows the symbol, the mode (daily range or the swing timeframe) and the magic number.

TODAYLevels and windowToday's levels, the window in market time and in server time, and the current spread.
RISKPosition and limitsThe open position, margin used, the day's P/L and the state of the prop firm protection.
RESULTSClosed tradesClosed trades and net P/L of this EA, plus the last 30 trades (one per position, partial closes grouped).
  • PAUSE blocks new entries. Pending orders are withdrawn and come back when you resume; a level the price goes through while paused is skipped for the day. PAUSE does not close anything.
  • CLOSE ALL asks for confirmation, then deletes the pending orders and closes the positions of this EA: its magic number on this symbol. Nothing else on the account.
  • Panel size: Normal (100%), Large (125%), XLarge (150%) or XXLarge (200%) for 2K and 4K screens. Show the panel = false hides it.
Update

Coming from the old version

This is a rebuild, not a patch: new engine, MT4 and MT5 from the same code, and a new default mode.

  1. 1Check the inputs of every chart after the update. The input names changed, so old .set files and saved chart settings do not carry over, and a chart can come back with the new factory values: daily range mode, gold window.
  2. 2To keep trading the old way: set Breakout levels to Swing highs and lows. The swing inputs keep their old meaning and factory values.
  3. 3Two factory values changed: the trailing stop is now off (it was on), and the lot size mode is now 0.5% of the current balance (it was 2% of a fixed initial size). Set them back by hand if you want the old ones.
  4. 4The old daily drawdown limit is gone: Prop Firm Protection (step 07) replaces it, measured on equity with open trades included.
  5. 5Max spread now works. In v1.50 that input had no effect.
FAQ

Questions I get asked

No. Before looking at any result I fixed four pass or fail checks for a default setting (out of sample, real ticks, stress and neighbouring windows). Neither gold nor USDJPY passed all four. So the ARB ships as a tool: you choose the market and the window, and the factory values are a template for XAUUSD. Step 05 has the starting points with their numbers and their limits.

No. One order per side of the range in daily mode, and the max buys and sells you set in swing mode (1 and 1 by default). Orders go out with their stop loss, unless you set the swing SL to 0.

The Experts tab says why. The usual reasons: an exchange holiday, the price already beyond a level when the range ended, a breakout during a blown-out spread or during a pause, a range outside the size filter, the daily trade limit, a prop firm limit, or Algo Trading switched off.

Yes, one chart per symbol and window. Give each chart its own magic number. The prop firm limits are shared: when one ARB chart hits them, all of them stop.

Daily range mode: any, the range is built from 1-minute candles (my tests ran on M15). Swing mode: the timeframe of the swings, the chart's or the one in Swing timeframe.

Use 1-minute OHLC to compare windows quickly, then confirm the one you keep with "Every tick based on real ticks". On indices, and with any trailing stop, the real ticks result is the one that counts.

Yes, on MT4 and MT5. The hours are market hours, so they carry over to any broker. Spreads, commissions and index symbol names change, and the numbers in step 05 were measured on Axi.

Setup

Where to run it

A range EA has to be on when the range ends and when it closes. That means a VPS, not your laptop.

Disclosure: these are affiliate links. You pay the same or less; I get a commission.
Support

Updates and support

  • Updates arrive through the MQL5 Market in your terminal.
  • Questions: support or support@doittrading.com. Send the symbol, your inputs and the Experts tab lines of the day, and I answer directly.
Scroll to Top