Clone Pending Set To Another Symbol
A grid or bracket built with EURUSD-sized pip distances is meaningless copied straight onto XAUUSD or a JPY cross - a 20-pip distance is a different fraction of typical daily range on every instrument. Simply copying prices across, or copying pip counts across, produces a clone that is either far too tight or far too wide for the target symbol's own behaviour. This script reads each symbol's own ATR first, computes the ratio ATR(target) / ATR(source), and scales every distance in the source structure by that ratio before sending it on the target symbol. A rung placed one ATR away from price on the source symbol lands one ATR away from price on the target symbol too - the actual grid or bracket shape is what gets cloned, not the raw numbers. Stop loss and take profit distances are scaled the same way, each relative to its own order's new entry price. Lot size is copied unchanged by default; an optional tick-value scaling is available for traders who want comparable monetary risk per rung on the second symbol rather than comparable lot size. Distances that scale down to less than the target symbol's stop/freeze minimum are skipped individually rather than sent invalid and rejected by the broker, and the summary states exactly how many were skipped for that reason. Notes and limitations - The source structure is read once and never modified or deleted - this is a copy, not a move. - ATR ratio scaling assumes ATR is a reasonable proxy for "typical movement" on both instruments. For symbols with very different session behaviour (a 24-hour FX pair versus an exchange instrument with a limited session), this is an approximation, not a guarantee of equivalent risk. - A newly added target symbol may need a few seconds for its price and ATR history to load after SymbolSelect() - if ATR cannot be read yet, the script says so and does nothing; simply try again shortly. - Order type is copied unchanged (buy limit stays buy limit, and so on) - the script does not attempt to reinterpret the structure's intent on a different instrument. - Lot size scaling by tick value is a coarse monetary-risk proxy, not a full margin or correlation calculation.
Script · MT4 · v1.0 · Free
About Clone Pending Set To Another Symbol
Clone Pending Set To Another Symbol is an expert advisor (trading robot) for MetaTrader 4 based on ATR. It places pending buy/sell stop or limit orders and has a news filter. It has 10 settings, such as Target symbol, Magic filter and Clone magic. MQL source code included.
Files in the download: ClonePendingsToSymbol.mq4, ClonePendingsToSymbol.txt.
Trading robots can lose money. Check every setting and test on a demo account before using real funds.
Settings
| Setting | Default | What it does |
|---|---|---|
| Target symbol | Symbol to clone the pending structure onto (must exist in Market Watch) | |
| Magic filter | -1 | Only clone orders with this magic (-1 = ignore magic) |
| Clone magic | 0 | Magic number assigned to the cloned orders (0 = keep original magic) |
| Atr period | 14 | ATR period used for both symbols |
| Atr timeframe | PERIOD_H1 | Timeframe the ATR is read from |
| Scale lots | false | Scale lot size by tick value ratio too (false = same lot size on both symbols) |
| Slippage pips | 3 | Slippage tolerance on the target symbol, pips |
| Max retries | 5 | Attempts per order before giving up |
| Retry wait ms | 500 | Pause between attempts, milliseconds |
| Confirm first | true | Ask for confirmation before sending anything |
How to install
- Download the ZIP from your PolyMaria library and unzip it.
- In MetaTrader 4 open File → Open Data Folder, then go to MQL4 → Experts.
- Copy the .mq4 file(s) there. Put any .mqh files in MQL4 → Include.
- Open the .mq4 file in MetaEditor and press Compile (F7) if MetaTrader does not show it.
- Drag the expert advisor from the Navigator onto a chart, check the settings, allow Algo/Auto Trading and press OK.
- Test it first on a demo account or in the Strategy Tester.
Tags: Gold (XAUUSD) · Grid · ATR · EURUSD · Pending Orders · News Trading · MT4 Script · MQL4 Source Code