Loading…

Asian Range Breakout EA

The Asian session is the thinnest of the three majors, so its range is often only a handful of points wide - trading every breakout of a range that narrow just trades noise. This implementation adds InpMinRangePips as an explicit floor: if the measured range is narrower than that, the whole day is skipped rather than taking a breakout trade against a range that was never wide enough to mean anything. That single check is what a naive port of "trade the session range" usually leaves out. Otherwise the mechanics match the standard session-breakout shape used elsewhere in this catalogue: the range is built from every closed bar whose open time falls between InpRangeStartHour and InpRangeEndHour in the broker's own server time, one trade is taken per calendar day after the window closes, the stop sits at the opposite range edge, and any open position is force-closed once InpSessionEndHour is reached. Position sizing can run as a fixed lot or, with InpUseRiskSizing on, as a percentage of equity risked to the range width, using MODE_TICKVALUE and MODE_TICKSIZE rather than a hardcoded contract size so it prices correctly on gold, indices and JPY crosses as well as plain FX pairs. Notes and limitations - Exactly one trade per calendar day (server date), and only when the range clears the InpMinRangePips floor - this EA does not re-arm intraday. - If the range-edge stop would land inside the broker's minimum stop distance, that day is skipped rather than sending an invalid order. - Only one position at a time, tracked by InpMagicNumber. It will not manage or interfere with trades opened manually or by another EA. - The minimum-range filter reduces noise trades but does not guarantee a genuine trend; a wide-enough range can still fail immediately after the breakout. - Requires AutoTrading enabled; if trading is disabled the EA logs it and skips the entry. - On the MQL5 build, entries refuse (and the day is marked as traded) on a netting account if the chart symbol already carries a position under a different magic number - see MQL4 VERSUS MQL5 DIFFERENCES above.

Expert advisor · MT4 · v1.0 · Free

About Asian Range Breakout EA

Asian Range Breakout EA is an expert advisor (trading robot) for MetaTrader 4. It trades only in the hours you set (time filter), can size trades from your balance and risk percent and trades breakouts. It has 13 settings, such as Range start hour, Range end hour and Session end hour. MQL source code included.

Files in the download: AsianRangeEa.ex4, AsianRangeEa.mq4, AsianRangeEa.txt.

Trading robots can lose money. Check every setting and test on a demo account before using real funds.

Settings

SettingDefaultWhat it does
Range start hour0Range window start, broker server hour (0-23)
Range end hour6Range window end, broker server hour (0-23) - breakout trades only after this hour
Session end hour9No new entries at or after this server hour; existing trade still managed
Min range pips15.0Minimum range width, in pips - narrower ranges are skipped for the day as noise
Stop loss pips0Extra stop-loss buffer beyond the range edge, in pips (0 = stop exactly at range edge)
Take profit pips0Take profit distance, in pips (0 = none, exit only on session end or reverse)
Use risk sizingfalseSize by percent risk instead of a fixed lot
Risk percent1.0Percent of equity risked per trade, when risk sizing is on
Fixed lots0.10Lot size when risk sizing is off, or as a fallback
Magic number20260609Magic number for orders opened by this EA
Slippage pips3Slippage tolerance, in pips
Max retries5Attempts per trade action before giving up
Retry wait ms500Pause between attempts, milliseconds

How to install

  1. Download the ZIP from your PolyMaria library and unzip it.
  2. In MetaTrader 4 open File → Open Data Folder, then go to MQL4 → Experts.
  3. Copy the .mq4 file(s) there. Put any .mqh files in MQL4 → Include.
  4. Open the .mq4 file in MetaEditor and press Compile (F7) if MetaTrader does not show it.
  5. Drag the expert advisor from the Navigator onto a chart, check the settings, allow Algo/Auto Trading and press OK.
  6. Test it first on a demo account or in the Strategy Tester.

Download the PDF guide

Tags: Breakout · Trading Sessions · Time Filter · Risk & Lot Size · MT4 Expert Advisor · MQL4 Source Code

Expert advisors (EA) for MT4 & MT5 · PolyMaria