Grid Trading Buy And Sell Stop enters trades based on grid steps, order distances, and multipliers then manages open positions with trailing stop loss, net profit targets in points or amount, and partial TP. Lot sizing starts at a fixed value and scales with martingale multipliers up to a maximum lot. Optional price zone filters and separate buy sell settings provide controls. The platform is MetaTrader 5.
Read from grid-buy-stop-v2.0.0.mq5. Defaults are the author's; change them in the EA's Inputs tab.
Name
Type
Default
Description
InpBuyEnable
bool
true
[Buy] Enable Trading
InpBuyGridType
ENUM_GRID_TYPE
GRID_CLOSE_ALL
[Buy] Grid Type
InpBuyGridStep
int
5000
[Buy] Grid Step (points)
InpBuyGridStepMultiplier
double
1.1
[Buy] Grid Step Multiplier
InpBuyFollowDistance
int
1500
[Buy] Follow Distance (points)
InpBuyOrderDistance
int
1000
[Buy] Order Distance (points)
InpBuySumNetType
ENUM_NET_PROFIT
NET_PROFIT_POINTS
[Buy] Net Profit (Points/Amount)
InpBuyNetProfitPoints
int
3000
[Buy] Net Profit Points (points)
InpBuyProfitTargetAmount
double
10.0
[Buy] TP (Amount)
InpBuyStartTrailAbroveAvgPoints
int
500
[Buy] Start Trailing Stop (points)
InpBuyTrailOffsetPoints
int
300
[Buy] Trailing Stop Offset (points)
InpBuyTrailOnlyTighten
bool
true
[Buy] Move SL just to get profit
Show all 39 inputs
Name
Type
Default
Description
InpBuyLotSize
double
0.01
[Buy] Start Lot
InpBuyMartingale
double
1.1
[Buy] Martingale Multiplier
InpBuyMaxLots
double
0.05
[Buy] Maximum Lot
InpBuyEnablePriceZone
bool
false
[Buy] Enable/Disable Price Zone
InpBuyUpperPrice
double
0.0
[Buy] Upper Price (0 = No Limit)
InpBuyLowerPrice
double
0.0
[Buy] Lower Price (0 = No Limit)
InpSellEnable
bool
false
[Sell] Enable Trading
InpSellGridType
ENUM_GRID_TYPE
GRID_CLOSE_ALL
[Sell] Grid Type
InpSellGridStep
int
5000
[Sell] Grid Step (points)
InpSellGridStepMultiplier
double
1.1
[Sell] Grid Step Multiplier
InpSellFollowDistance
int
1500
[Sell] Follow Distance (points)
InpSellOrderDistance
int
1000
[Sell] Order Distance (points)
InpSellSumNetType
ENUM_NET_PROFIT
NET_PROFIT_POINTS
[Sell] Net Profit (Points/Amount)
InpSellNetProfitPoints
int
3000
[Sell] Net Profit Points (points)
InpSellProfitTargetAmount
double
10.0
[Sell] TP (Amount)
InpSellStartTrailAbroveAvgPoints
int
500
[Sell] Start Trailing Stop (points)
InpSellTrailOffsetPoints
int
300
[Sell] Trailing Stop Offset (points)
InpSellTrailOnlyTighten
bool
true
[Sell] Move SL just to get profit
InpSellLotSize
double
0.01
[Sell] Start Lot
InpSellMartingale
double
1.1
[Sell] Martingale Multiplier
InpSellMaxLots
double
0.05
[Sell] Maximum Lot
InpSellEnablePriceZone
bool
false
[Sell] Enable/Disable Price Zone
InpSellUpperPrice
double
0.0
[Sell] Upper Price (0 = No Limit)
InpSellLowerPrice
double
0.0
[Sell] Lower Price (0 = No Limit)
InpMagicNumber
int
2025111201
Magic Number
InpSlippage
int
10
Slippage (points)
InpTradeComment
string
Grid_BuySellStop
Comment
How to Install It
1Download the sourceUse "Download source (.zip)" above, or clone thino-dev/FOREX_EA_MQL5_Grid_Trading_V1 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.
This collection of MetaTrader 5 expert advisors implements various technical strategies using indicators such as Moving Averages, MACD, and the Andean Oscillator. It includes a specific tool for trading based on Commitment of Traders data combined with SuperTrend signals. Most robots in the repository incorporate a gri
This repository contains a large collection of over 100 expert advisors for the MetaTrader 5 platform, many of which appear to be generated using the Mission Automate tool. The library covers a wide variety of trading methodologies including range breakouts, Ichimoku cloud strategies, Heiken Ashi engulfing patterns, an
This repository provides a collection of MetaTrader 4 and 5 expert advisors, including the modular Super Trading Bot series and an AI-driven trading template. The EAs utilize various technical indicators like Bollinger Bands, Parabolic SAR, and moving averages for trend-following and scalping. Built-in risk management
This repository is a large collection of over 1,000 expert advisors designed for the MetaTrader 5 platform. It serves as an open-source library featuring various algorithmic trading strategies, including moving average crossovers, RSI levels, Parabolic SAR, and range breakouts. The collection provides robots for trend
This collection of expert advisors for MetaTrader 4 and 5 provides various automated strategies based on price action and technical indicators. The primary EA utilizes a moving average crossover system with switchable modes for different market conditions. It features a martingale lot-scaling system for sideways market
This repository is a substantial collection of nearly five hundred Expert Advisors for the MetaTrader 5 platform. The library includes various automated strategies such as divergence detection using RSI and MACD, moving average crossovers, and zone recovery systems. It features a mix of trading robots, indicator-based