Loading…

Copy Objects Between Charts

A trader who marks up levels on a 1H chart often wants the same lines visible on the 4H and daily charts of that symbol too, without redrawing them by hand three times. This script walks every currently open chart with ChartFirst()/ChartNext(), keeps only the ones on the same symbol as the source chart, and recreates every matching object on each of them. Copying is restricted to the same symbol on purpose. A trend line drawn at 1.2500 means something specific on EURUSD; copying its raw price and time coordinates onto a USDJPY chart would place a line at a price that symbol will never trade near, which is not "the same idea elsewhere", it is meaningless output. Different timeframe on the same symbol is fine - the coordinates stay meaningful there, which is the actual point of the tool. Object copying is generic rather than type-specific: it reads however many time/price anchor points that object type actually has (one for a horizontal line, two for a trend line, three for a Fibonacci tool, and so on) and every common display property - colour, width, style, text, font - then recreates the object on the target chart with the same values, skipping anchor indices a given type does not use rather than copying garbage. Notes and limitations Only same-symbol charts are eligible targets - there is no override, by design, since cross-symbol coordinates are not meaningful. If no other open chart shares the source symbol, the script reports that and does nothing. Object names are reused as-is, so two objects with the same name on source and target are treated as "the same object" for the InpSkipExisting check; rename before copying if that collision is not wanted. Does not copy indicators or EAs attached to the source chart, only drawn objects.

Script · MT4 · v1.0 · Free

About Copy Objects Between Charts

Copy Objects Between Charts is a script for MetaTrader 4. It draws buy and sell arrows on the chart and can alert you with a pop-up, sound, email or push message. It has 3 settings, such as Prefix filter, Skip existing and Confirm first. MQL source code included.

Files in the download: CopyObjectsBetweenCharts.mq4, CopyObjectsBetweenCharts.txt.

Settings

SettingDefaultWhat it does
Prefix filterOnly copy objects starting with this prefix (blank = all)
Skip existingtrueSkip a target object if the same name already exists there
Confirm firsttrueAsk for confirmation before copying

How to install

  1. Download the ZIP from your PolyMaria library and unzip it.
  2. In MetaTrader 4 open File → Open Data Folder, then go to MQL4 → Scripts.
  3. Copy the .mq4 file(s) there. Put any .mqh files in MQL4 → Include.
  4. Open the .mq4 file in MetaEditor and press Compile (F7) if MetaTrader does not show it.
  5. Drag the script onto a chart to run it once.

Download the PDF guide

Tags: Buy/Sell Arrows · Alerts · MT4 Script · MQL4 Source Code

MQL4 & MQL5 scripts · PolyMaria