Most forex power meters use arithmetic calculations — easy pip variations or proportion modifications averaged throughout pairs.
There’s a mathematically cleaner method that solves a number of issues without delay.
When measuring the power of EUR in opposition to 7 different main currencies, the arithmetic method sums the pip modifications of all 7 EUR pairs.
This works, but it surely creates a scaling drawback. EURJPY strikes 100 pips whereas EURCHF strikes 10 pips.
The JPY pair dominates the calculation no matter its precise significance.
The geometric imply method takes the seventh root of the product of all 7 pair values.
Every pair contributes proportionally to the ultimate index worth, no matter its absolute value stage.
A 1 % transfer in EURCHF has the identical influence on the EUR index as a 1 % transfer in EURJPY.
In MQL5, this may be applied utilizing the CustomSymbolCreate perform to generate artificial chart symbols.
The method for a EUR basket index seems to be like this:
pow((EURCAD * EURCHF * (EURJPY/100) * EURAUD * EURUSD * EURGBP * EURNZD), 0.142857)
The division of EURJPY by 100 normalizes the JPY pairs to the identical scale as the opposite pairs.
The exponent 0.142857 is just 1/7.
What makes this fascinating is a mathematical property that emerges while you calculate all 8 forex indices this manner.
The sum of all 8 day by day pip modifications all the time equals zero.
If EUR gained 45 pips and USD gained 124 pips throughout their respective baskets, the remaining 6 currencies should collectively present precisely -169 pips.
This zero-sum property is just not an approximation.
It’s a mathematical certainty of the geometric imply building utilized to a closed set of currencies.
It supplies a built-in validation mechanism: in case your calculations don’t sum to zero, one thing is improper.
For anybody keen on constructing customized artificial symbols in MT5, the important thing features are CustomSymbolCreate, CustomRatesUpdate and CustomTicksAdd.
The primary problem is dealing with dealer rollover durations round midnight the place unfold widening can create synthetic spikes in your artificial charts.
I’ve printed a free indicator on the CodeBase that demonstrates the geometric imply method utilized to the USD index:
MATTRIX USDx Examine. It compares the official ICE-weighted USDX with an equal-weighted model utilizing the identical 6 pairs.
https://www.mql5.com/en/code/72600

