Trading robot · MT5

Opening Range Breakout MT5

by anas1412

This MetaTrader 5 expert advisor executes trades based on opening range breakout logic.

GitHub stars5
Forks1
Last update6 days ago16 Sep 2026
LicenceMIT
Latest releasev1.0.13 weeks ago

Overview

The system identifies a price range over a specific duration and enters positions when the market breaks through these levels. It supports multiple entry methods including market orders on candle close, resting stop orders, or limit retests. Risk management features include automated lot sizing based on account risk percentage, adjustable stop losses relative to range size, and take profit targets defined by reward-to-risk multiples. It also provides time-based exits and filters for spread and range volatility.

Details

Author

anas1412 on GitHub

Type

Trading robot

Platform

MetaTrader 5 (MQL5)

Strategy

Breakout

Markets

Any symbol

Timeframes

M1-M5, M15-H1

Risk profile

No grid, martingale or hedging logic was found in its code or README. That says nothing about how it performs: backtest it first.

Topics

algorithmic-tradingbacktestingexpert-advisorforexmetatrader5mql5opening-range-breakoutprop-tradingquantitative-financetrading-bot

Input parameters

Read from ORB.mq5. Defaults are the author's; change them in the EA's Inputs tab.

NameTypeDefaultDescription
InpShowPanelbooltrueShow the on-chart control panel
InpTimeZoneENUM_SESSION_TZTZ_UTCSession timezone
InpStartHourint0Session start hour (in that zone)
InpStartMinuteint0Session start minute
InpRangeMinutesint15Range length (minutes)
InpSignalTFENUM_TIMEFRAMESPERIOD_M1Signal timeframe
InpNoEntryAfterMinint15No entry after (min from range close, 0=off)
InpForceCloseMinint360Force close all (min from range close, 0=off)
InpMaxHoldMinutesint90Max hold per position (min from its fill, 0=off)
InpWinterOffsetint2Broker winter offset (hours ahead of UTC)
InpFollowsUSDSTbooltrueBroker uses US DST dates (false = EU)
InpEntryModeENUM_ENTRY_MODEENTRY_MARKET_ON_CLOSEEntry mode
Show all 40 inputs
NameTypeDefaultDescription
InpMaxTradesPerDayint1Max trades per day
InpMaxSpreadPointsdouble0Max spread (points, 0=off)
InpMinRangePointsdouble0Min range size (points, 0=off)
InpMinRangePercentdouble0.14Min range size (percent of price, 0=off)
InpMaxRangePointsdouble0Max range size (points, 0=off)
InpRangeLookbackint0Rolling filter: sessions to compare against (0=off)
InpMinRangeRatiodouble1.25Rolling filter: range must be this x the median
InpMinClosePosdouble0.50Trade only the half the range closed in (0.50=midpoint, 0=off)
InpYdayFilterboolfalseSkip breaks against yesterday's daily candle (off: not in the published config)
InpYdayMinBodydouble30.0...only when that candle's body is at least this (price units)
InpTradeLongsbooltrueTrade upside breaks
InpTradeShortsbooltrueTrade downside breaks
InpTradeMonbooltrueTrade Monday
InpTradeTuebooltrueTrade Tuesday
InpTradeWedbooltrueTrade Wednesday
InpTradeThubooltrueTrade Thursday
InpTradeFriboolfalseTrade Friday (off: only losing day of the week)
InpSLModeENUM_SL_MODESL_PERCENT_OF_RANGESL mode
InpSLPercentOfRangedouble50.0SL percent of range (50=midpoint, 100=far side)
InpSLFixedPointsdouble0SL fixed distance (points)
InpStopMoveAtRdouble0.5Move stop when trade reaches (R, 0=off)
InpStopMoveToRdouble-0.5Move stop to (R: 0=entry, -0.5=half risk left)
InpTPModeENUM_TP_MODETP_RRTP mode
InpRRdouble2.0Reward:risk multiple
InpTPFixedPointsdouble0TP fixed distance (points)
InpTPRangeMultipledouble1.0TP as multiple of range size
InpLotModeENUM_LOT_MODELOT_RISK_PERCENTLot sizing mode
InpLotsdouble0.01Fixed lot size

How to install it

  1. 1Download the sourceUse "Download source (.zip)" above, or clone anas1412/orb-mt5 from GitHub, and unzip it.
  2. 2Open the data folderIn MetaTrader choose File, then Open Data Folder, and go to MQL5/Experts.
  3. 3Copy the filesCopy the .mq5 file into Experts, and any .mqh files into the Include folder the code expects.
  4. 4Compile in MetaEditorOpen the file in MetaEditor and press Compile. Fix any missing includes the compiler reports.
  5. 5Test before you tradeRun it in the Strategy Tester, then attach it to a demo chart and allow algorithmic trading.
Third-party code. ForexR did not write, test or endorse this EA, and the summary above was generated automatically from its README and code. ForexR lists only repositories with readable source code and never hosts files. Read the code, backtest it and use a demo account first; automated trading can lose money quickly.

Similar expert advisors

Gold ORB

by yulz008
295 stars

This MetaTrader 5 expert advisor implements an open range breakout strategy specifically designed for gold trading on the hourly timeframe. It identifies the high and low of the initial trading hour and establishes a definitive range after a user-defined consolidation period. Trades are triggered when price breaks thro

MT5 Trading robot Breakout
Updated 3 years ago None stated GitHub repository of Gold ORB

Nyao Scalper

by elrizwiraswara
173 stars

Nyao Scalper is an automated scalping robot for MetaTrader 5 that utilizes a multi-factor weighted scoring system to identify trade opportunities. It evaluates trend alignment through EMA crossovers, momentum via RSI, and price action through wick rejection and candle body analysis. The EA manages risk with adaptive AT

MT5 Trading robot ScalpingTrend followingMartingale High risk
Updated 3 months ago BSD-3-Clause GitHub repository of Nyao Scalper

Golden Strategist EA

by raracraz
68 stars

This MetaTrader 5 expert advisor specializes in trading Gold (XAUUSD) by targeting volatility during the New York session. It utilizes an Average True Range (ATR) indicator to identify market trends and determine entry levels for limit orders. Risk management includes fixed stop loss parameters and dynamic trailing sto

MT5 Trading robot Trend followingBreakout
Updated 2 years ago None stated GitHub repository of Golden Strategist EA

Black XAU Automated Bot

by phatnomenal
48 stars

Black XAU is an automated trading robot for MetaTrader 5, specifically designed for gold. It utilizes a multi-timeframe breakout and retest strategy, identifying trading zones based on initial H4 market structure. Entries are triggered on the M5 timeframe when price retests a confirmed breakout level. The expert adviso

MT5 Trading robot BreakoutTrend following
Updated 11 months ago None stated GitHub repository of Black XAU Automated Bot

Box Breakout EA

by je-zhou
27 stars

This MetaTrader 5 expert advisor implements a box breakout strategy designed for the foreign exchange market. The robot identifies price ranges during specific time windows and enters trades upon a breakout. It features a trend filter using fast and slow moving averages to align entries with broader market direction. R

MT4MT5 Trading robot BreakoutTrend following
20 stars

First Candle Breakout is a MetaTrader 5 expert advisor designed to trade the breakout of the high or low of the first candle within a specified period. While traditionally used with the first 60-minute candle, the software allows users to configure any timeframe for the initial range. The robot enters a buy position wh

MT5 Trading robot Breakout

More trading robots

Need a broker for MT5?

Compare regulated brokers that support MetaTrader, with spreads, minimum deposits and leverage side by side.

Compare brokers