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.
Multi-layer grid system with three independent layers
Automatic anchor price and grid spacing detection
Real-time visual grid lines on the price chart
Smart state recovery for active positions after restarts
Read from GridTradingEA.mq5. Defaults are the author's; change them in the EA's Inputs tab.
Name
Type
Default
Description
InpLotSize
double
0.01
Lot Size (min 0.01)
InpLevel0Price
double
0.0
Level 0 Price (0 = auto from current price)
InpGridDistPrice
double
0.0
Grid Distance in PRICE (e.g. 5.0 for Gold = $5)
InpGridDistPoints
int
0
Grid Distance in POINTS (used if Price dist = 0)
InpTPDistPrice
double
0.0
TP Distance in PRICE (0 = same as Grid Distance)
InpTPDistPoints
int
0
TP Distance in POINTS (used if Price dist = 0)
InpLayer1Start
int
1
Layer 1 Start Position
InpLayer1End
int
5
Layer 1 End Position
InpLayer1GridDist
int
10
Layer 1 Grid Distance (points)
InpLayer2Start
int
6
Layer 2 Start Position
InpLayer2End
int
10
Layer 2 End Position
InpLayer2GridDist
int
20
Layer 2 Grid Distance (points)
Show all 23 inputs
Name
Type
Default
Description
InpLayer3Start
int
11
Layer 3 Start Position
InpLayer3End
int
15
Layer 3 End Position
InpLayer3GridDist
int
30
Layer 3 Grid Distance (points)
InpMaxOpenPositions
int
5
Maximum Open Positions
InpSlippage
int
30
Slippage (points)
InpMagicNumber
int
123456
Magic Number
InpShowGridLines
bool
true
Show Grid Lines on Chart
InpVisibleLevels
int
15
Grid Lines visible above/below price
InpAnchorColor
color
clrGold
Anchor Level (L0) Color
InpActiveLevelColor
color
clrLime
Active Trade Level Color
InpInactiveLevelColor
color
clrGray
Inactive Level Color
How to install it
1Download the sourceUse "Download source (.zip)" above, or clone Shifrozy/Grid_Trading_EA_MT5 from GitHub, and unzip it.
2Open the data folderIn MetaTrader choose File, then Open Data Folder, and go to MQL5/Experts.
3Copy the filesCopy the .mq5 file into Experts.
4Compile in MetaEditorOpen the file in MetaEditor and press Compile. Fix any missing includes the compiler reports.
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.
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
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
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
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
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
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