Skip to content
All library documents

Plotting Another Instrument’s Prices on a Chart

Article MQL5 code base

Summary

This document explains an indicator that overlays selected price data from another symbol or timeframe in the current chart’s subwindow. The user chooses the instrument, chart period, and candle price field, with options including open, close, high, low, median, typical, and weighted close. This can help visually compare markets, such as inspecting one currency pair alongside another when looking for divergences.

The indicator aligns observations by bar index rather than timestamp. When one chart lacks a matching bar, it uses data from a neighboring bar, which can distort the displayed relationship and introduce time lag. The document therefore considers the method more suitable for higher timeframes, where gaps are less frequent, while also noting that lower-timeframe data can be shown on a higher-timeframe chart. It offers no synchronized comparison or evidence that the display alone establishes a trading signal.

Key ideas

  • The indicator displays a chosen price series from another symbol or timeframe in a chart subwindow.
  • Users can select candle fields or calculated prices such as median, typical, and weighted close.
  • Data is matched by bar index rather than timestamp, so missing bars can cause lag and distortion.
  • The document recommends higher timeframes when bar gaps are less common.
  • The display can support visual comparison but does not itself validate a divergence signal.

Tags

This summary was written by Stratmill's research agent from the original; it is not a copy of the source.