Currency Strength Oscillator MT4
- Indicators
-
Narayanan Mohanan Mohanan Krishnan
MT5/MQL5 developer building Expert Advisors, custom indicators, and backtesting and validation tools. I focus on clean, well-documented, no-repaint code: closed-bar logic, validated buffers, proper handle and memory management. This is the engineering that separates a reliable tool from a fragile - Version: 1.0
- Activations: 10
Currency Strength Oscillator for MetaTrader 4
A relative currency strength indicator that plots the history of the eight majors.
This currency strength oscillator plots the relative strength of the eight major currencies as a history, decomposed from the 28 major pairs. While a standard currency strength meter tells you where things stand right now, this shows how they got there — which currency has been strengthening, which has rolled over, and where the ranking changed hands.
All eight series are exposed as documented indicator buffers, so an Expert Advisor can read the currency strength directly from MetaTrader 4.
How the decomposition works
Each of the eight currencies appears in seven of the twenty-eight pairs. Its strength is the average of those seven readings, with the sign inverted wherever it is the quote currency — a falling AUDJPY means a strengthening yen, not a weakening one.
Every pair contributes to exactly two currencies, positively to its base and negatively to its quote, so across the full set those contributions cancel and the eight strengths sum to zero. The indicator uses that as an internal check: if the values did not balance, the decomposition would be wrong. It also means the readings are relative rather than absolute. A currency is not strong on its own, only strong against the rest of the set.
Because the calculation reads the currencies rather than the chart, the same eight lines appear whatever symbol the indicator sits on.
What the history shows that a snapshot cannot
A ranking tells you the order today. A history tells you how long it has held, whether the leader is still climbing or already turning, and when two currencies swapped places. Crossings are where the ranking changed hands.
Individual currencies can be switched off, which is often more useful than watching all eight. Plotting only the two that make up the chart's own symbol gives a clean read on which side is driving it.
Two ways to measure strength
Rate of change is the percentage move across the lookback. It is directly comparable between pairs because it is relative.
Standardised distance from the mean expresses the same move in standard deviations, which keeps instruments of very different volatility on one scale.
They behave differently at long lookbacks. At a lookback of 200, rate of change accumulates a persistent offset — several currencies sit above or below zero for the whole window without crossing it — while the standardised measure stays centred. Neither is wrong. Rate of change describes the move that actually happened; the standardised measure describes how unusual it was. At short lookbacks the difference is small.
Pair mode
Pair mode plots a single line: the strength of one currency minus another. It is the same decomposition, reduced to one relationship, and it works on any chart — CHF minus JPY can be watched while trading EURAUD.
This is not the same as the price of CHFJPY. The price is one market's quote; this is the difference between two currencies each measured against the whole matrix.
Beyond the majors
The indicator runs on any chart, not only FX. On a gold or index chart the currency lines still describe the currencies, which is often exactly what is wanted — a dollar-priced instrument is easier to read when the dollar itself is visible beside it. More than one instance can be attached, at different lookbacks, to compare a faster and a slower view.
Note what is and is not being claimed there. Gold is not part of the 28-pair matrix and has no strength value of its own. What the chart shows is the dollar, measured from the FX matrix, displayed alongside gold's price. The honest reading is that the dollar weakened while gold rallied — not that gold was strong.
Reading it from an Expert Advisor
Ten buffers are exposed and documented. Buffer order is fixed and alphabetical, and does not change with the display switches — hiding a currency removes it from the chart but the buffer keeps its values, so an EA is unaffected by a user's display preference.
double jpy = iCustom(Symbol(), Period(), "CurrencyStrengthOscillator", 5, 1); // buffer 5 is always JPY, shift 1 is the last closed bar
- 0 — AUD
- 1 — CAD
- 2 — CHF
- 3 — EUR
- 4 — GBP
- 5 — JPY
- 6 — NZD
- 7 — USD
- 8 — zero line
- 9 — pair spread, base minus quote, populated in pair mode
Inputs
- Strength measure — rate of change, or standardised distance from the mean
- Lookback — the window each reading is measured over, in bars; 14 by default
- Smoothing — a moving average applied to the result; 3 by default, 1 for none
- Bars to calculate — how far back to compute; 500 by default, 0 for all available history
- Symbol suffix — detected automatically, and can be set by hand for unusual broker naming
- Show a single pair spread — switches to pair mode, with a base and quote currency to compare
- Show AUD through Show USD — one switch per currency, all on by default and ignored in pair mode
What the screenshots show
- All eight currencies on GBPUSD hourly — the yen separating from the pack while the dollar and the pound fall away, alongside the price move that accompanied it.
- The Data Window — the buffers against a single bar, each one named and readable by an Expert Advisor. The eight currency values in it sum to 0.001, which is the zero-sum property surviving a round trip through three decimal places of display rounding.
- USDJPY daily with only two currencies plotted — the dollar and the yen, where the crossings line up with the turns in price and nothing else competes for attention.
- XAUUSD hourly with the dollar isolated, at two lookbacks — two instances of the indicator in separate windows, one slower and one faster. The shorter lookback turns first, the longer confirms.
- Pair mode on CHFJPY daily — a single line, the Swiss franc minus the yen.
- The inputs dialog — every setting, with the MT4 properties window.
How far back it plots
The decomposition needs all 28 pairs on a bar to mean anything, so the usable depth is the shortest history among them — and brokers hold far less history on minor crosses than on majors. Where the available history is shorter than requested, the indicator plots what it can and reports the limit once in the Experts log.
On short timeframes this is invisible. It becomes visible on Weekly and Monthly, where the common history can be a few hundred bars or fewer, and the oscillator will start part-way across a chart whose price runs back much further. That is the limit, not a fault. It is a property of broker data and applies to every currency strength tool — most simply do not tell you.
Bars to calculate defaults to 500. Raising it, or setting 0 for all available history, gives a longer view at the cost of a slower first load on a new timeframe.
Calculation behaviour
Closed-bar values are final. The forming bar updates until it closes, and is recomputed on each tick rather than being frozen at first touch, so its value settles at the close instead of recording whatever the price happened to be when the bar opened.
Every bar is decomposed from all 28 pairs or not at all. Each currency is averaged over the pairs that actually contributed to it rather than over an assumed seven. A strength computed from a partial set looks exactly like a real reading and cannot be identified as wrong later, so the indicator does not produce one.
Where a broker's history is missing a bar for one of the 28 pairs, that pair's last known close is carried forward rather than the pair being dropped, and the substitution is reported in the Experts log with the pair name and the number of bars affected. MetaTrader 4 feeds contain such gaps more often than MetaTrader 5 ones, so the two platforms can differ by a small amount around session boundaries.
About the screenshots. The images are captured in MetaTrader 5. The MetaTrader 4 build is a direct port and was verified against it buffer by buffer, on every timeframe, comparing the two terminals bar for bar. The one difference found is the feed-gap handling described above, and it is the only one: what the currency strength oscillator calculates is the same on both platforms. What differs is the terminal itself — chart rendering and the layout of the settings dialog.
Notes
- Draws in a separate window, with ten indicator buffers. The buffer map above is fixed and does not change with the display switches.
- All 28 major pairs must be available from your broker. The indicator reports any that are missing by name in the Experts log.
- The plotted range is limited by the shortest history among the 28 pairs, which is visible on Weekly and Monthly. The limit is reported once in the Experts log.
- More than one instance can be attached to the same chart, at different lookbacks or different measures.
- No external dependencies. Every value is calculated inside the indicator. It does not call any other indicator, so there are no handles to fail, nothing to install alongside it, and no dependency on the state of your standard indicator folder.
What this is and is not
This is a tool for technical analysis and for filtering market conditions. It is not a trading system, it produces no buy or sell signals, it gives no investment advice, and it does not open or manage positions.
It is descriptive rather than predictive. It measures what the eight currencies have been doing; it does not forecast what they will do next, and no claim is made about its performance.
| More tools from this developer I build MT4 indicators and Expert Advisors with an emphasis on clean, documented, no-repaint code — closed-bar logic, validated buffers, and no dependencies on other indicators. If you want the current picture across all 28 pairs and nine timeframes at once, the Multi Timeframe Currency Strength Panel is free and uses the same decomposition. This indicator is its history. Questions about the calculation, the buffers, or using this in your own EA? Send me a private message — I am happy to answer. |
Built and maintained by Narayanan Mohanan, MT4/MQL4 developer.
