Alan Ross

Alan Ross Forex

Free Forex Indicators, MetaTrader Tools and Honest Trading Guides

Learn Forex

How to Check Forex Correlation on MT4: Prices Said 0.91, Bar-by-Bar Changes Said 0.42

Key takeaways

  • How to check the correlation between two markets on MetaTrader 4 — here EURUSD and gold — and which settings give an honest number, tested on 13,631 matched 5-minute bars from June to August 2026.
  • Correlate price changes, not prices. On the same bars, correlating closing prices gave 0.91. Correlating bar-to-bar changes gave 0.42 on M5 and 0.52 on H1. The price version more than doubled the link.
  • The window length decides how noisy the number is. A 20-bar window on M5 went from -0.66 to +0.96 and read negative 10% of the time. A 100-bar window never went meaningfully below zero; on H1, 50 bars already never went negative.
  • Shorting gold as a EURUSD hedge barely works. At equal risk it cut the swings of a EURUSD position by 1.7%. Even the best-sized hedge cut them by only 14.4%.
  • Holding long EURUSD and long gold at equal risk made the combined swings 74% bigger than EURUSD alone — it is mostly one dollar trade, twice.

MetaTrader 4 has no built-in correlation indicator, so most traders judge it by eye: two charts side by side, both going up, “they’re correlated”. That method gives the wrong number. I measured how wrong on EURUSD and gold, and which settings to use when you calculate it properly. The full correlation study — timeframes, sessions, and whether gold predicts EURUSD — is in my EURUSD and gold correlation test.

If you don’t have MT4 yet, start with downloading MetaTrader 4 on a PC.

How do I see correlation between two pairs in MT4?

MetaTrader 4 on a laptop with EURUSD and gold charts tiled

There are three ways, from quickest to most accurate:

  1. By eye. Open both charts on the same timeframe, then Window → Tile Vertically. Quick, but it shows you price levels, which is exactly what inflates the number — see the next section.
  2. Export and calculate. Press F2 (Tools → History Center), pick the symbol and timeframe, click Export and save a CSV. Do the same for the second market. With a chart active, File → Save As saves the bars on screen as a CSV too.
  3. A correlation indicator. Free ones exist in the MQL5 code base. Before you trust one, check in its inputs or code whether it correlates prices or changes, and what window it uses.

For the export route, in Excel or Google Sheets:

  • Put both files side by side and keep only the rows where the time matches. EURUSD and gold have different trading breaks — of 16,926 EURUSD bars and 13,736 gold bars, only 13,631 opened at the same minute.
  • In a new column, compute the change of each bar: =C3/C2-1 for close prices in column C.
  • Correlate the two change columns: =CORREL(E3:E102, H3:H102) for a 100-bar window.

On MT5 you can also drag a second symbol from Market Watch onto a chart to overlay it, which is handy for looking — but it is still a price overlay, with the same problem. My MT4 vs MT5 comparison covers the other differences.

Should you correlate prices or price changes?

Spreadsheet calculating correlation from exported price data

Changes. This is the single biggest setting, and most correlation tables online don’t say which one they used.

EURUSD vs gold, June–August 2026Correlating pricesCorrelating changes
Whole period, M50.910.42
Whole period, H10.910.52
20-bar window on M5: range-0.90 to +0.99-0.66 to +0.96
20-bar window on M5: time below zero20.7%10.0%
100-bar window on M5: time below zero17.7%0.2%

Over the whole period, both markets drifted up — EURUSD from about 1.133 to 1.171, gold from about $3,970 to $4,750 — and two lines that both drift up correlate at 0.9 no matter what they do bar by bar. Over short windows the price version does the opposite: it jumps between +0.99 and -0.90, because in 20 bars a small drift in either line decides the sign. The change version is lower overall and much steadier. It is the one that answers the trading question: when EURUSD moves, how often does gold move with it?

What window length should you use?

Changes, windowAverageLowestHighestTime below zero
M5, 20 bars (1h40)0.34-0.660.9610.0%
M5, 50 bars0.36-0.390.912.6%
M5, 100 bars (8h20)0.37-0.040.850.2%
M5, 200 bars0.390.110.810%
M15, 50 bars0.43-0.010.900.3%
H1, 20 bars0.50-0.050.911.4%
H1, 50 bars0.520.220.810%
H1, 100 bars0.520.250.700%

Short windows on M5 are mostly noise. A 20-bar reading said the two markets moved against each other one tenth of the time, when over the full period they clearly move together. If you saw -0.5 on a 20-bar M5 window and decided the relationship had “broken”, you would have been reading noise: the 100-bar window on the same chart went below zero on 0.2% of readings.

What I would use: H1 with 50 bars, about two trading days. It never went below zero, it still moves enough to show a real change (0.22 to 0.81), and it gives the same average as the whole period. If you trade M5 and want a faster reading, use at least 100 bars.

Does the timeframe change the correlation?

Yes, upward. The average correlation of changes was 0.42 on M5, 0.49 on M15, 0.52 on H1, 0.55 on H4 and 0.57 on daily closes. Short bars carry more noise that belongs to one market only, and that noise cancels out on longer bars. So a correlation from someone’s daily table will look stronger than what you see on a scalping chart. Compare numbers only on the same timeframe.

Can you hedge EURUSD with gold?

Because the correlation is positive, a short gold position should offset part of a long EURUSD one. I measured how much on 1,086 matched hourly bars. Gold’s hourly swings were 4.66 times bigger than EURUSD’s in percentage terms, so the size of the gold side matters a lot.

Position, per 1 lot of EURUSDHourly swing vs EURUSD alone
Long EURUSD only100%
Short gold, same dollar amount (about 0.27 lot of gold)423% — far worse
Short gold, equal risk (about 0.06 lot)98.3% — cut by 1.7%
Short gold, best size (about 0.03 lot)85.6% — cut by 14.4%
Long gold, equal risk (about 0.06 lot)174% — 74% bigger

Standard deviation of hourly changes of the combined position. Lot sizes for gold at 100 ounces per lot, with EURUSD near 1.16 and gold near $4,300; your broker’s contract size may differ.

A same-dollar gold short more than quadrupled the swings, because gold moves so much more. At equal risk, the hedge removed almost nothing: with a correlation of 0.52, the part that cancels is small. The best possible size — 11% of the EURUSD position’s dollar value in gold — cut the swings by 14.4%, which is the most a 0.52 correlation allows. That is a weak hedge for the extra spread you pay on a second trade.

The last row is the one worth remembering. Long EURUSD plus long gold at equal risk is not two diversified trades — it is a dollar short with 74% more swing. If you hold both, size them together using my position sizing table.

Can you use the correlation for trade signals?

Not on these bars. Gold’s last 5-minute bar had a 0.044 correlation with EURUSD’s next one, and trading EURUSD after a big gold bar lost in 15 of 16 setups after costs. As a filter on an EMA cross, the best of 24 gold filters still lost 0.71 pips per trade — details in my gold filter vs EMA cross test. Settings that did work on gold itself are in best MT4 settings for gold scalping.

What correlation settings would I use on MT4?

  • Correlate changes, never price levels. The price version gave 0.91 where the real figure was 0.42.
  • H1, 50 bars for a stable reading; on M5, no less than 100 bars.
  • Match the bar times before calculating. Different trading breaks shift the rows.
  • Compare numbers only on the same timeframe — the same pair read 0.42 on M5 and 0.57 daily.
  • Use correlation for risk, not for entries. Long EURUSD and long gold is one dollar trade; size it as one.

Frequently asked questions

Does MT4 have a correlation indicator?

No, not built in. You can export bars with History Center (F2 → Export) and use CORREL in Excel on bar-to-bar changes, or install a free correlation indicator from the MQL5 code base after checking that it uses changes rather than prices.

What is the correlation between EURUSD and gold?

Positive and moderate. On 13,631 matched 5-minute bars from June to August 2026, the correlation of bar-to-bar changes was 0.42 on M5, 0.52 on H1 and 0.57 on daily closes. Correlating price levels instead gave 0.91, which overstates it.

What period should I use for a correlation indicator?

50 bars on H1 was the most practical in this test: it never read below zero and still showed real changes, from 0.22 to 0.81. A 20-bar window on M5 read negative 10% of the time and is mostly noise.

Can I hedge EURUSD by shorting gold?

Only weakly. At equal risk the short gold position cut hourly swings by 1.7%; at the best size, about 0.03 lot of gold per lot of EURUSD, by 14.4%. A same-dollar gold short more than quadrupled them.

Why is price correlation higher than return correlation?

Because both prices drifted up over the period, and any two rising lines correlate strongly. Correlating bar-to-bar changes removes the drift and measures whether the markets actually move together.

Want a clean indicator to install right now?

It is my own enhanced DeMARK Trend Line indicator for MetaTrader 4 and 5. Non repaint, clean, and free.

Download the Free DeMARK Indicator

Written by Alan Ross

Forex trader and MetaTrader indicator developer. I build and test MT4 and MT5 tools, then write the honest version of how they actually work. More about me.

Last reviewed October 2026
Alan Ross
Alan Ross

Forex educator and indicator developer. I build and trade my own MetaTrader tools, and share the ones that genuinely help.

Leave a comment

Your email address will not be published. Comments are reviewed before they appear.