Nicolas

Currency Strength Meter: the 8 major currencies with MarketData

Studio Only
Category: Indicators By: Nicolas Created: December 2, 2026, 1:07 PM
December 2, 2026, 1:07 PM
Indicators
0 Comments
ProRealCode Script
Currency Strength Meter: the 8 major currencies with MarketData

Eight lines in one panel, one per major currency: USD, EUR, GBP, JPY, CHF, AUD, CAD and NZD. Each line is how strong that currency has been against the seven others over the last bars, so the currency on top is the one the market is buying and the one at the bottom the one it is selling, whatever instrument the chart shows.

This code is written in ProRealCode Script and runs with ProRealCode Studio on ProRealTime Web.

How it works

  • MarketData(“EURUSD”, default, close, default) reads another instrument from the same code. Seven pairs against the US dollar are enough: every other cross follows from them.
  • Each currency’s move against the dollar over the lookback is measured in % on a log scale (the yen, the franc and the Canadian dollar are quoted the other way round, hence the minus sign).
  • A currency’s strength is its average move against the seven others: (8 × its move − the sum of the eight) / 7. That formula is a FUNCTION, called eight times, each call smoothed by its own Average.
  • DRAWLABEL names each line at its right end.

How to use it

Paste the code into a new Studio tab and press Ctrl + Enter. The lookback and the smoothing are fields of the Variables form. It works on any chart; a forex chart in real time shows the moves as they happen. The pairs are read on the chart’s timeframe and joined bar by bar without reading the future.

// ProRealCode Script example — currency strength meter
// Seven forex pairs read with MarketData give the strength of the eight major
// currencies, drawn as eight lines in one panel. A currency's strength is its
// average move against the seven others over the lookback, in %.

DEFPARAM overlay = false

input(len, 20, "Lookback (bars)", int)
input(smooth, 3, "Smoothing (bars)", int)

// Seven pairs against the US dollar, on the chart's timeframe
eurusd = MarketData("EURUSD", default, close, default)
gbpusd = MarketData("GBPUSD", default, close, default)
audusd = MarketData("AUDUSD", default, close, default)
nzdusd = MarketData("NZDUSD", default, close, default)
usdjpy = MarketData("USDJPY", default, close, default)
usdchf = MarketData("USDCHF", default, close, default)
usdcad = MarketData("USDCAD", default, close, default)

// Each currency's move against the dollar over the lookback, in % (log scale)
rUSD = 0
rEUR = LOG(eurusd / eurusd[len]) * 100
rGBP = LOG(gbpusd / gbpusd[len]) * 100
rAUD = LOG(audusd / audusd[len]) * 100
rNZD = LOG(nzdusd / nzdusd[len]) * 100
rJPY = -LOG(usdjpy / usdjpy[len]) * 100
rCHF = -LOG(usdchf / usdchf[len]) * 100
rCAD = -LOG(usdcad / usdcad[len]) * 100
total = rUSD + rEUR + rGBP + rJPY + rCHF + rAUD + rCAD + rNZD

// Average move of one currency against the seven others
FUNCTION strength(r, sumAll)
(8 * r - sumAll) / 7
ENDFUNCTION

usd = Average[smooth](strength(rUSD, total))
eur = Average[smooth](strength(rEUR, total))
gbp = Average[smooth](strength(rGBP, total))
jpy = Average[smooth](strength(rJPY, total))
chf = Average[smooth](strength(rCHF, total))
aud = Average[smooth](strength(rAUD, total))
cad = Average[smooth](strength(rCAD, total))
nzd = Average[smooth](strength(rNZD, total))

// Each line named at its right end
IF islastbarupdate THEN
DRAWLABEL(barindex + 1, usd, "USD", none, small, left) COLOURED(60, 190, 120)
DRAWLABEL(barindex + 1, eur, "EUR", none, small, left) COLOURED(90, 170, 255)
DRAWLABEL(barindex + 1, gbp, "GBP", none, small, left) COLOURED(190, 150, 255)
DRAWLABEL(barindex + 1, jpy, "JPY", none, small, left) COLOURED(240, 90, 90)
DRAWLABEL(barindex + 1, chf, "CHF", none, small, left) COLOURED(230, 230, 235)
DRAWLABEL(barindex + 1, aud, "AUD", none, small, left) COLOURED(240, 180, 60)
DRAWLABEL(barindex + 1, cad, "CAD", none, small, left) COLOURED(255, 120, 170)
DRAWLABEL(barindex + 1, nzd, "NZD", none, small, left) COLOURED(80, 210, 210)
ENDIF

RETURN usd AS "USD" COLOURED(60, 190, 120) STYLE(line, 2), eur AS "EUR" COLOURED(90, 170, 255) STYLE(line, 2), gbp AS "GBP" COLOURED(190, 150, 255) STYLE(line, 2), jpy AS "JPY" COLOURED(240, 90, 90) STYLE(line, 2), chf AS "CHF" COLOURED(230, 230, 235) STYLE(line, 2), aud AS "AUD" COLOURED(240, 180, 60) STYLE(line, 2), cad AS "CAD" COLOURED(255, 120, 170) STYLE(line, 2), nzd AS "NZD" COLOURED(80, 210, 210) STYLE(line, 2), 0 AS "0" COLOURED(110, 110, 120)
No ITF file for this code
A Studio Only code is not imported into ProRealTime™. Copy it and paste it into the ProRealCode Studio editor.
Nicolas
Nicolas Legend
I created ProRealCode because I believe in the power of shared knowledge. I spend my time coding new tools and helping members solve complex problems. If you are stuck on a code or need a fresh perspective on a strategy, I am always willing to help. Welcome to the community!
Author’s Profile

Comments

ProRealCode ProRealCode
Loading...