Loading…

Correlation Heat Strip

Checking correlation against a handful of related pairs usually means opening a separate multi-symbol tool or scrolling through a matrix. This indicator keeps a short, fixed watchlist visible directly on the chart as a strip of small coloured cells - one per symbol - so the current correlation reading for each is visible without leaving the chart or opening anything else. Each cell shows the symbol's rolling Pearson correlation of bar-to-bar percentage returns against the chart symbol's own returns, over the same InpWindow-bar lookback, aligned in time via iBarShift so the two symbols' bars line up correctly even when their bar counts or session hours differ slightly. The cell's fill colour follows a discrete green-to-red ramp: strongly positive correlation is green, strongly negative is red, and anything in the middle third is grey ("no meaningful relationship right now"). The chart's own symbol, if it appears in the list, is shown as a neutral grey "(self)" cell rather than a meaningless self-correlation of 1.0. Notes and limitations - A symbol not already in Market Watch has its history load kicked off with SymbolSelect() in OnInit, but that load is not instantaneous - a cell can briefly show "n/a" right after the indicator is attached, on a symbol list that includes a currently hidden/unloaded symbol, until history finishes syncing. - Correlation is computed on percentage returns (close-to-close), not raw price, and is linear (Pearson) only; a strong non-linear relationship between two symbols would read weaker than its true strength. - All symbols are compared on the chart's own timeframe. There is no cross-timeframe option in this version. - The colour ramp is discrete (five bands), not a smooth gradient - a deliberate choice to keep the colour math to named constants only and avoid MQL4's BGR-ordered colour type, which silently swaps red and blue under raw bit-shift arithmetic.

Indicator · MT4 · v1.0 · Free

About Correlation Heat Strip

Correlation Heat Strip is an indicator for MetaTrader 4. It has 8 settings, such as Symbol list, Window and Corner. MQL source code included.

Files in the download: CorrelationHeatStrip.ex4, CorrelationHeatStrip.mq4, CorrelationHeatStrip.txt.

Settings

SettingDefaultWhat it does
Symbol listGBPUSD,USDJPY,USDCHF,AUDUSDComma-separated symbol list (max 10 used)
Window50Bars in the rolling correlation window
CornerCORNER_LEFT_UPPERPanel corner
X offset10Horizontal offset from the corner, pixels
Y offset20Vertical offset from the corner, pixels
Cell width70Width of one symbol's cell, pixels
Cell height34Height of one symbol's cell, pixels
Cell gap4Gap between cells, pixels

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 → Indicators.
  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 indicator from the Navigator onto a chart and adjust the settings.

Download the PDF guide

Tags: Multi-Currency · MT4 Indicator · MQL4 Source Code

MetaTrader 4 & 5 indicators · PolyMaria