Skip to content
← Back to the research library
MQL5 SOURCE COLLECTION / Breakout

Asian Range: Percentage Breakout

Builds a percentage band around a timed M1 opening price and trades breaks on either side.

MT5 / MQL5Original sourceUnverified source

M1 anchor / server-time window · Published 28 October 2026

Source inspectionLimited static review
MetaEditor compilationNot performed
Backtest / live recordNot supplied

How the source is structured

  1. Once per day, after the trigger time, anchor a band to the current M1 open.
  2. Buy above the upper band and sell below the lower band, consuming each side's trigger after an attempt.
  3. At the end time, attempt to close positions matching the chart symbol and configured magic number.

Default inputs

As supplied; these are not optimized or recommended settings.
Anchor time / end time06:00 / 22:00 server time
Band width on each side0.5% of the anchor price
Volume0.1 lot
Stop / target0.5% / 0.5%
Magic number123
BEFORE YOU TEST

Source-review notes

These observations come from reading this uploaded version. They are not compiler output or a complete code audit. The download retains the source as supplied.

SOURCE LINES 49–57

The band uses the current M1 open when initialization occurs after the trigger time. A late start does not reconstruct the 06:00 open.

SOURCE LINES 78–92

This is a breakout implementation despite the original 'Drop' filename. It does not measure an actual Asian-session high/low range.

SOURCE LINES 83–92

Triggers are cleared without checking order success, and the sell request passes ask as its price.

Dependencies

MetaTrader 5 standard Trade library. The band is calculated directly from M1 prices.

Source & attribution

The original filename includes 'Rene'; the source contains no author or license declaration.

Included in the Edge Quant source collection with existing notices preserved. Free download does not imply a new license grant.

Original filename: Rene Asian Drop version.mq5
Encoding: UTF-8

Inspect the original source

The browser preview is decoded for reading; the download keeps the original file bytes.

Direct .mq5 file ↓
Expand full MQL5 source · 96 lines
#define OBJ_PREFIX_BOX "Box"#include <Trade/Trade.mqh>input double Lots = 0.1;input double TpPercent = 0.5;input double SlPercent = 0.5;input ulong Magic = 123;input double RangePercent = 0.5;input int TriggerTimeMin = 360;input int EndTimeMin = 1320;input bool IsCloseAtEndTime = true;double rangeHigh;double rangeLow;CTrade trade;int OnInit(){   trade.SetExpertMagicNumber(Magic);      return(INIT_SUCCEEDED);}void OnDeinit(const int reason){}void OnTick(){   MqlDateTime dt;   TimeCurrent(dt);      dt.hour = (int)(TriggerTimeMin / 60);   dt.min = (int)(TriggerTimeMin % 60);   dt.sec = 0;      datetime triggerTime = StructToTime(dt);      dt.hour = (int)(EndTimeMin / 60);   dt.min = (int)(EndTimeMin % 60);   datetime endTime = StructToTime(dt);      static int lastDay = 0;   if(lastDay != dt.day_of_year){      rangeHigh = 0;      rangeLow = 0;            datetime time0 = iTime(_Symbol,PERIOD_M1,0);      static datetime timestamp;      if(timestamp != time0 && TimeCurrent() >= triggerTime){         timestamp = time0;         lastDay = dt.day_of_year;                  double open0 = iOpen(_Symbol,PERIOD_M1,0);         rangeHigh = open0 + open0*RangePercent / 100;         rangeLow = open0 - open0*RangePercent / 100;                  string objName = OBJ_PREFIX_BOX + "" + TimeToString(triggerTime);         ObjectCreate(0,objName,OBJ_RECTANGLE,0,triggerTime,rangeHigh,endTime,rangeLow);               }    }        if(IsCloseAtEndTime && TimeCurrent() >= endTime){      for(int i = PositionsTotal() - 1; i >= 0; i--){         CPositionInfo pos;         if(pos.SelectByIndex(i) && pos.Symbol() == _Symbol && pos.Magic() == Magic){            trade.PositionClose(pos.Ticket());          }       }     }         if(TimeCurrent () < endTime){      double bid = SymbolInfoDouble(_Symbol,SYMBOL_BID);      double ask = SymbolInfoDouble(_Symbol,SYMBOL_ASK);            if(rangeHigh > 0 && bid > rangeHigh){         double tp = 0;         if(TpPercent > 0 ) tp = ask + ask*TpPercent / 100;         double sl = ask - ask*SlPercent / 100;                  trade.Buy(Lots,_Symbol,ask,sl,tp,"Box Trading");         rangeHigh = 0;      }      if (rangeLow > 0 && bid <rangeLow){         double tp = 0;         if(TpPercent > 0) tp = bid - bid * TpPercent / 100;         double sl = bid + bid*SlPercent / 100;                  trade.Sell(Lots,_Symbol,ask,sl,tp,"Box Trading");         rangeLow = 0;      }    }    }

SHA-256: a318febe71ec6d30032476831096789b2989e49dbd53275a7adaa5a79b70f400

Educational source material, not investment advice. No profitability, execution quality or live-readiness claim is made for this upload.