Trading robot · MT4 · MT5

Box Breakout EA

by je-zhou

This MetaTrader 5 expert advisor implements a box breakout strategy designed for the foreign exchange market.

GitHub stars26
Forks8
Last update1 year ago2 Jul 2025
LicenceMIT

Overview

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. Risk management includes automatic lot sizing based on account percentage, a stop loss calculated as a factor of the range height, and a trailing stop. Users can limit the maximum number of trades per day and set specific hours for closing all open positions.

Details

Author

je-zhou on GitHub

Type

Trading robot

Platform

MetaTrader 4 (MQL4) and MetaTrader 5 (MQL5)

Strategy

Breakout, Trend following

Markets

Forex

Timeframes

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.

Input parameters

Read from Box Breakout v1.4.mq5. Defaults are the author's; change them in the EA's Inputs tab.

NameTypeDefaultDescription
TimeframeENUM_TIMEFRAMESPERIOD_CURRENT
Magicint1Magic (Need to use magic number for each different EA)
LotSizedouble0.1
RiskPercentdouble0.5RiskPercent (0 = Use Fixed LotSize)
TpPointsdouble0TPoints (0 = No TP)
TpFactordouble0TpFactor (0 = Use TpPoints)
SlFactordouble1.0SlFactor (Multiplier for stop loss distance - 1.0 = at opposite range, 2.0 = 2x range distance)
TslTriggerPointsdouble0TslTriggerPoints (0 = No Tsl)
TslTriggerFactordouble0.75TslTriggerFactor (0 = Use TslTriggerPoints)
TslPointsdouble25TslPoints (0 = Breakeven)
TradeWithTrendbooltrueTradeWithTrend (Forces strategy to only trade with the trend)
TrendMaTimeframeENUM_TIMEFRAMESPERIOD_H1TrendMaTimeframe (The timeframe the trending moving average should be calculated)
Show all 29 inputs
NameTypeDefaultDescription
SlowTrendMaMethodENUM_MA_METHODMODE_SMASlowTrendMaMethod (The type of moving average used to determine the slow trend)
SlowTrendMaPeriodint200SlowTrendMaPeriod (The period used to calculate the slow trending moving average)
FastTrendMaMethodENUM_MA_METHODMODE_SMMAFastTrendMaMethod (The type of moving average used to determine the fast trend)
FastTrendMaPeriodint60FastTrendMaPeriod (The period used to calculate the fast trending moving average)
RangeBufferdouble0RangeBuffer (Amount in points between the two moving averages to represent a ranging market)
RangeTimeframeENUM_TIMEFRAMESPERIOD_H1RangeTimeframe (Fixed timeframe for consistent range calculation)
RangeStartHourint3
RangeStartMinuteint0
RangeEndHourint7
RangeEndMinuteint30
StopTradingHourint17
StopTradingMinuteint30
ClosePositionsHourint19
ClosePositionsMinuteint55
MaxTradesPerDayint1MaxTradesPerDay (Maximum number of executed trades per day - EA cancels remaining orders when limit reached)
HistoricalDaysint30HistoricalDays (Number of past days to display ranges for - maximum 50)
ShowAllTradingLinesbooltrueShowAllTradingLines (Show trading window lines for all historical ranges)

How to install it

  1. 1Download the sourceUse "Download source (.zip)" above, or clone je-zhou/Forex-Algotrading-Strategies--MQL5- from GitHub, and unzip it.
  2. 2Open the data folderIn MetaTrader choose File, then Open Data Folder, and go to MQL4/Experts or MQL5/Experts.
  3. 3Copy the filesCopy the .mq4 / .mq5 file into Experts.
  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

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

Binario

by EarnForex
20 stars

Binario is a breakout expert advisor for MetaTrader 4 and 5 that utilizes a price channel constructed from two moving averages of the same period. By default, it uses a 144-period exponential moving average applied to both highs and lows. It enters trades when the price moves outside this band by a predefined pip dista

MT4MT5 Trading robot BreakoutTrend following
Updated 1 year ago Apache-2.0 GitHub repository of Binario

Prop Firm EA Fleet

by cgemise971
20 stars

Prop Firm EA Fleet is a collection of MetaTrader 5 robots designed for passing prop firm evaluations and managing funded accounts. The suite utilizes various strategies including market structure analysis, session range breakouts for London and New York sessions, and high-frequency scalping. It features strict risk man

MT5 Trading robot SMC / ICT / price actionBreakoutScalping High risk
Updated 9 months ago None stated GitHub repository of Prop Firm EA Fleet

Hybrid Swing EA

by clevergoldfox
15 stars

This MetaTrader 4 expert advisor executes a regime-gated breakout strategy specifically optimized for XRP and ETH markets. It operates on the H4 timeframe, utilizing Bollinger Bands for entry signals coupled with ADX and ATR filters to identify high-volatility trend environments. The EA employs a one-shot entry approac

MT4 Trading robot BreakoutTrend following
Updated 8 months ago None stated GitHub repository of Hybrid Swing EA

More trading robots

Need a broker for MT4/MT5?

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

Compare brokers