Loading…

Chart Object Time Shift Tool

After a broker changes server time - a DST transition, a server migration, a history rebase - drawings that used to line up with a session boundary or a specific candle are suddenly off by exactly that offset. Re-dragging every trend line and Fibonacci tool by hand is slow and imprecise. This script shifts the time anchors of every matching object by an exact, user-specified amount in one run. A multi-point object has several time anchors, and all of them must move by the same amount or its shape distorts - a trend line's slope would visibly change if only one endpoint shifted. This script shifts every anchor index a given object type actually has, never assuming a fixed count, so a two-point trend line and a three-point Fibonacci fan are both handled correctly without special-casing each type by hand. Objects with no meaningful time anchor (horizontal lines, labels, buttons, rectangle labels) are left alone rather than shifted, since there is nothing time-based about them to correct - shifting them would be a no-op at best and a false sense of completeness at worst. Notes and limitations Object types with no genuine time anchor are counted separately as skipped, not silently ignored - the summary line reports both numbers. The shift is a plain, uniform offset applied identically to every anchor of every matching object; it does not attempt to detect or correct for DST automatically, the offset must be worked out and entered by the trader. Running the script twice with the same offset shifts objects twice - there is no undo beyond running it again with the negated offset.

Script · MT5 · v1.0 · Free

About Chart Object Time Shift Tool

Chart Object Time Shift Tool is a script for MetaTrader 5. It draws buy and sell arrows on the chart and can alert you with a pop-up, sound, email or push message. It has 4 settings, such as Prefix filter, Shift hours and Shift days. MQL source code included.

Files in the download: ObjectTimeShiftTool.ex5, ObjectTimeShiftTool.mq5, ObjectTimeShiftTool.txt.

Settings

SettingDefaultWhat it does
Prefix filterOnly shift objects starting with this prefix (blank = all)
Shift hours0Shift amount in hours (can be negative)
Shift days0Shift amount in whole days (can be negative), added to hours
Confirm firsttrueAsk for confirmation before shifting

How to install

  1. Download the ZIP from your PolyMaria library and unzip it.
  2. In MetaTrader 5 open File → Open Data Folder, then go to MQL5 → Scripts.
  3. Copy the .mq5 file(s) there. Put any .mqh files in MQL5 → Include.
  4. Open the .mq5 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: Fibonacci · Trend · Trading Sessions · Buy/Sell Arrows · Alerts · MT5 Script · MQL5 Source Code

MQL4 & MQL5 scripts · PolyMaria