Trading robot · MT5

Grid EA

by MubinCodes

This MetaTrader 5 expert advisor implements a grid trading strategy specifically designed for sideways or range-bound market conditions.

High risk

GitHub stars1
Forks1
Last update3 months ago11 Jun 2026
LicenceNone stated

Overview

Grid EA places multiple buy and sell orders at fixed intervals defined by the user. The EA includes several operational filters, such as specific trading days and time sessions. Risk management features include range-based closing, where the robot exits positions if the price moves outside a set boundary, and a profit-target restart mechanism. It features an on-chart display for tracking running profit but lacks traditional per-trade stop losses, relying instead on basket management and range limits.

Details

Author

MubinCodes on GitHub

Type

Trading robot

Platform

MetaTrader 5 (MQL5)

Strategy

Grid, Hedging

Markets

Any symbol

Timeframes

Any timeframe

Risk profile

  • Opens a grid of orders: exposure builds up in a trend
  • Holds opposite positions at once
  • Trades without a fixed stop loss

EA files

Input parameters

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

NameTypeDefaultDescription
gap70stringDay Settings
Allow_Monday_tradingbooltrue
Allow_Tuesday_tradingbooltrue
Allow_Wednesday_tradingbooltrue
Allow_Thursday_tradingbooltrue
Allow_Friday_tradingbooltrue
Allow_Saturday_tradingboolfalse
Allow_Sunday_tradingboolfalse
gap2string-----------------------------------------------------
SessionsstringTime
Trading_time_startstring02:00Session start(MT5 time)
Trading_time_endstring23:59Session end (MT5 time)
Show all 26 inputs
NameTypeDefaultDescription
gap40string-----------------------------------------------------
LotSizedouble0.01
GridGapdouble50
TotalGridLinesint100GridLines(Each Side)
gap41string-----------------------------------------------------
CloseWhenOutOfRangebooltrue
gap42string-----------------------------------------------------
RestartWhenHitProfitTargetboolfalse
TargetAmountdouble10
gap72string-----------------------------------------------------
FontSizedouble15
FontColorcolorclrRed
gap73string-----------------------------------------------------
RestartWhenOutOfTheRangeboolfalse

How to install it

  1. 1Download the sourceUse "Download source (.zip)" above, or clone MubinCodes/Grid-EA 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.
  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

8 stars

High Frequency Grid EA is an automated trading robot for MetaTrader 5 that implements a mean-reversion strategy through a grid of pending orders. It places buy and sell stop orders at calculated distances, using dynamic spread monitoring to ensure execution only during favorable conditions. The EA includes a trailing s

MT5 Trading robot GridMean reversionScalping High risk

Grid Trading MT5

by algocode2022
6 stars

This grid trading robot for MetaTrader 5 automates the placement of multiple limit orders within a user-defined price range. It populates the market with a configurable number of buy and sell limit orders between specified high and low boundaries. The expert advisor includes risk management features such as individual

MT5 Trading robot GridHedging High risk
Updated 2 years ago GPL-3.0 GitHub repository of Grid Trading MT5

EA XAUUSD Premium

by diditgravatar
4 stars

This MetaTrader 5 expert advisor is designed for gold trading, utilizing a multi-timeframe strategy across the M15, H1, and H4 charts. It integrates technical indicators including ADX, RSI, and Moving Averages to identify trend-following and breakout opportunities. Risk controls include dynamic lot sizing based on acco

MT5 Trading robot Trend followingBreakoutGrid High risk
Updated 1 year ago None stated GitHub repository of EA XAUUSD Premium
3 stars

This expert advisor facilitates arbitrage trading between futures and spot instruments, primarily targeting gold and stock indices. Available for MetaTrader 4 and 5, it monitors the price difference between two related symbols against a moving average to identify trade opportunities. The logic includes a noise-filterin

MT4MT5 Trading robot ArbitrageMean reversionGrid High risk
Updated 3 years ago None stated GitHub repository of Gold Futures Spot Arbitrage

AutoTrade EA

by liucheng-12-08
3 stars

AutoTrade EA is a scalping robot for MetaTrader 4 and 5 that utilizes a multi-indicator signal scoring system based on Exponential Moving Average crossovers and RSI levels. It employs an aggressive trade management strategy featuring a dynamic grid and a stepped martingale lot scaling system where position sizes increa

MT4MT5 Trading robot ScalpingIndicator crossoverMartingale High risk
Updated 7 months ago None stated GitHub repository of AutoTrade EA

MT5 Hedge Trading Portal

by ahmedabdurahim
3 stars

This MetaTrader 5 expert advisor provides an interactive on-chart trading interface for manual execution and automated strategy management. It features dedicated graphical buttons for market entry along with input fields for volume, stop loss, and take profit levels. The repository includes distinct modules for hedging

MT5 Trading robot HedgingGrid High risk

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