Indicator Offset Shifter
Judging whether an indicator leads or lags price (or another series) by eye, without shifting anything, is guesswork. This tool reads one named buffer of a target custom indicator via iCustom twice per bar: once at the current shift for the "Original" line, and once at shift + N for the "Shifted" line, where N is the configurable offset. Plotting both together in the same subwindow makes a consistent lag or lead visually obvious - if the shifted line tracks the original line's past shape closely, the indicator is lagging by roughly N bars. The shift is done by re-reading the underlying series at a different bar index, not by moving the plotted line's on-chart pixel position - the latter would desynchronise the line from the subwindow's own time axis and every other object drawn in it. Notes and limitations - Calls the target indicator with no extra parameters beyond symbol/timeframe/mode/shift, the same constraint as any generic iCustom-based tool - it uses the target's own compiled defaults. - Both lines plot in this indicator's own subwindow on this indicator's own vertical scale. If the target indicator is normally a chart-window overlay (e.g. a moving average in price units), both lines here still display correctly relative to each other, just not overlaid on the price chart itself. - The shifted line goes empty (EMPTY_VALUE) at either end of the loaded history where shift + N falls outside the available bar range, which is expected and not a bug. - This is a visual comparison tool only; it does not compute or report a numeric lag/correlation figure.
Indicator · MT5 · v1.0 · Free
About Indicator Offset Shifter
Indicator Offset Shifter is an indicator for MetaTrader 5. It has 3 settings, such as Indicator name, Buffer index and Shift bars. MQL source code included.
Files in the download: IndicatorOffsetShifter.ex5, IndicatorOffsetShifter.mq5, IndicatorOffsetShifter.txt.
Settings
| Setting | Default | What it does |
|---|---|---|
| Indicator name | Examples\\Awesome Oscillator | Target indicator (path under MQL5\Indicators, no extension) |
| Buffer index | 0 | Buffer/mode index to read on the target |
| Shift bars | 5 | Bars to pull the series forward by (0 = no shift) |
How to install
- Download the ZIP from your PolyMaria library and unzip it.
- In MetaTrader 5 open File → Open Data Folder, then go to MQL5 → Indicators.
- Copy the .mq5 file(s) there. Put any .mqh files in MQL5 → Include.
- Open the .mq5 file in MetaEditor and press Compile (F7) if MetaTrader does not show it.
- Drag the indicator from the Navigator onto a chart and adjust the settings.
Tags: MT5 Indicator · MQL5 Source Code