Grid Copier
- Utilità
- Aleh Piatrenka
- Versione: 1.0
Automatically copies BUY/SELL trade openings from one trading account (MASTER) to another account (SLAVE) with automatic synchronization of a shared Take Profit.
Designed for grid, averaging, and martingale strategies where multiple positions in the same direction are combined into a single grid with one common Take Profit.
The SLAVE account fully follows the MASTER account’s trading logic and does not make any independent trading decisions.
Grid Copier is suitable for traders who want to copy grid strategies between accounts, test trading ideas and algorithms across different accounts, and for prop traders, trading teams, and VPS users who need stable and synchronized trade copying without manual intervention.
How it works. For example, the MASTER opens a BUY position on EURUSD with a lot size of 0.12 and sets a Take Profit. The SLAVE automatically opens a BUY position with the same TP. The lot size can be calculated proportionally to the SLAVE deposit (recommended mode) or set to a 1:1 ratio - this is configured in the input parameters. Next, the MASTER opens a second averaging BUY position with a lot size of 0.24 and updates the single Take Profit for the entire BUY grid, even if SELL positions exist at the same time. The SLAVE automatically repeats the second BUY trade and synchronizes the shared TP only for the BUY grid. All BUY positions are closed together at the common Take Profit.
The solution is resilient to internet disconnects, “no connection” errors, terminal restarts, and broker-side delays. It also supports automatic symbol mapping if brokers use different instrument names (for example, EURUSDm, EURUSD_i).
Grid Copier is optimized for strategies with a single shared Take Profit, but TP synchronization can be disabled in the settings if needed. Stop Loss is not copied to the SLAVE (this is part of the strategy logic). Only one SLAVE account is supported (multi-SLAVE support is planned in future versions). Partial closes and pending orders are not supported on the SLAVE. The EA is not recommended for ultra-fast scalping.
Setup:
- Create a Google Apps Script (step-by-step setup instructions are available in my MQL5 blog). This is a free relay server used for exchanging trade events between MASTER and SLAVE.
- In MetaTrader 5, enable WebRequest for your Google Apps Script URL and allow algorithmic trading.
- Install Grid Copier on the required symbol on the MASTER account (the source account) and set the role to MASTER in the input parameters.
- Install Grid Copier on the same symbol on the SLAVE account (the target account) and set the role to SLAVE in the input parameters.
- Enter the Google Apps Script URL in the GridCopier inputs on both MASTER and SLAVE.
- Enter the Api Key from Google Apps Script (for example, I_AM_API_KEY) in the inputs on both MASTER and SLAVE. The Api Key is a simple “password” that protects your copying channel from unauthorized access (you can use any text).
- Set the same Channel Name on both MASTER and SLAVE (for example: symbol_copier). This is the trade queue name and must match on both sides.
Each independent MASTER–SLAVE pair must use its own unique Channel Name. - Set the Slave ID for Server on the SLAVE, for example: slave_1.
- Copying will start automatically.
