Trading robot · MT5

Grid Trading EA MT5

by Shifrozy

This MetaTrader 5 expert advisor implements a multi-layer grid trading system suitable for forex, gold, and indices.

High risk

GitHub stars3
Forks0
Last update5 weeks ago18 Aug 2026
LicenceNone stated

Overview

Grid Trading EA MT5 establishes a grid of price levels around an anchor point, opening buy positions when the price crosses down through a specific level. The grid is divided into three customizable layers, each with independent distance settings to manage price action. Risk management features include a maximum open position limit and configurable lot sizes, though it lacks a traditional stop loss for individual trades.

Details

Author

Shifrozy on GitHub

Type

Trading robot

Platform

MetaTrader 5 (MQL5)

Strategy

Grid

Markets

Forex, Gold, Indices

Timeframes

Any timeframe

Risk profile

  • Opens a grid of orders: exposure builds up in a trend
  • Trades without a fixed stop loss

Input parameters

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

NameTypeDefaultDescription
InpLotSizedouble0.01Lot Size (min 0.01)
InpLevel0Pricedouble0.0Level 0 Price (0 = auto from current price)
InpGridDistPricedouble0.0Grid Distance in PRICE (e.g. 5.0 for Gold = $5)
InpGridDistPointsint0Grid Distance in POINTS (used if Price dist = 0)
InpTPDistPricedouble0.0TP Distance in PRICE (0 = same as Grid Distance)
InpTPDistPointsint0TP Distance in POINTS (used if Price dist = 0)
InpLayer1Startint1Layer 1 Start Position
InpLayer1Endint5Layer 1 End Position
InpLayer1GridDistint10Layer 1 Grid Distance (points)
InpLayer2Startint6Layer 2 Start Position
InpLayer2Endint10Layer 2 End Position
InpLayer2GridDistint20Layer 2 Grid Distance (points)
Show all 23 inputs
NameTypeDefaultDescription
InpLayer3Startint11Layer 3 Start Position
InpLayer3Endint15Layer 3 End Position
InpLayer3GridDistint30Layer 3 Grid Distance (points)
InpMaxOpenPositionsint5Maximum Open Positions
InpSlippageint30Slippage (points)
InpMagicNumberint123456Magic Number
InpShowGridLinesbooltrueShow Grid Lines on Chart
InpVisibleLevelsint15Grid Lines visible above/below price
InpAnchorColorcolorclrGoldAnchor Level (L0) Color
InpActiveLevelColorcolorclrLimeActive Trade Level Color
InpInactiveLevelColorcolorclrGrayInactive Level Color

How to install it

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

GridMaster Pro

by sajidmahamud835
128 stars

An automated MetaTrader 5 expert advisor that executes a bi-directional grid trading strategy. It uses the Average True Range (ATR) indicator to dynamically calculate grid spacing, allowing the system to adapt to current market volatility. The robot supports neutral, bullish, and bearish modes. It includes risk managem

MT5 Trading robot GridMean reversion High risk
Updated 5 months ago MIT GitHub repository of GridMaster Pro

MultiTrader

by mazmazz
14 stars

MultiTrader is a multi-currency expert advisor for MetaTrader 4 and MetaTrader 5 that executes trades across multiple forex instruments concurrently. It uses a modular system of filters to generate entry and exit signals based on various technical indicators. The EA manages risk through fixed or trailing stop losses, b

MT4MT5 Trading robot GridMulti-strategy High risk
Updated 5 years ago GPL-3.0 GitHub repository of MultiTrader

Punlie Grid

by punlie
10 stars

Punlie Grid is a MetaTrader 5 expert advisor that executes a grid trading strategy tailored for gold, crude oil, and cryptocurrencies. It places orders at fixed point intervals and features a trend-following filter that uses daily timeframe data to align trades with the prevailing market direction. Risk controls includ

MT5 Trading robot GridTrend following High risk
Updated 1 year ago MIT GitHub repository of Punlie Grid

RSI Martingale EA

by peefpee
10 stars

This Expert Advisor for MetaTrader 5 implements a martingale trading strategy triggered by the Relative Strength Index (RSI). It opens an initial position when RSI reaches overbought or oversold thresholds. If price continues to move against the initial trade, the EA layers additional orders at set point intervals, mul

MT5 Trading robot MartingaleMean reversionGrid High risk
10 stars

This MetaTrader 5 expert advisor automates trading based on Smart Money Concepts and Order Block identification. It analyzes price action across multiple timeframes, utilizing higher timeframe data for trend context and lower timeframes for entries. The system includes trade management tools such as break-even triggers

MT5 Trading robot SMC / ICT / price actionGrid High risk

Smart Grid Martingale EA

by chenhengyi53-design
9 stars

This MetaTrader 5 expert advisor executes a grid trading strategy enhanced with martingale lot scaling. The system identifies market direction through multi-timeframe analysis using Exponential Moving Averages and the Average Directional Index. It features dynamic grid spacing that adjusts based on market volatility an

MT5 Trading robot GridMartingaleTrend following High risk
Updated 7 months ago None stated GitHub repository of Smart Grid Martingale EA

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