Hi mgwuk
Glad you posed this question as I have been trying for the last number of weeks to ask the same question of IG and am still waiting on a response. Did you come up with an answer?
My workings below on how to calculate EMA clearly does not match IG Chart using IG data and EMA indicator and the method provided by IG which can be calculated as follows for example for EMA21:
where:
k = smoothing parameter which is 2/(lookback period+1) or for EMA21 is 2/(21+1) = 0.0909091
EMAt = previous candle EMA21 value
Both formulae below result in same value
EMA21 = k * close price + (1-k) * EMAt
or
EMA21 = EMAt + k *(close price-EMAt)
The following values in blue are taken from the 5 minute interval Nikkei 225 Japan Cash from IG charts looking at EMA21.
You can see from the table below the difference in calculated values using the above formula versus the IG chart data.
Sydney Time
Close Price
calc_EMA21
IGchart_EMA21
11/04/2024 1:25
39282.2
39274.0922
39274.0922
11/04/2024 1:30
39252.2
39272.1020
39272.1056
11/04/2024 1:35
39192.2
39264.8381
39264.8428
11/04/2024 1:40
39167.2
39255.9619
39255.9682
11/04/2024 1:45
39172.2
39248.3472
39248.3530
Obviously, the chart data is using a different formula. The SMA values align perfectly as you found.