iMA value different from Chart

 

Hi, I spent hours staring at the simple code below which I used to extract the value of 30 LWMA using iMA function. To my surprise, the value from iMA is different from that shown on the chart. Here is my code:

iMA(Symbol(),PERIOD_H4,30,0,MODE_LWMA,MODE_CLOSE,0) = 121.9779

On the GBPJPY H4 chart, the value for 30 LWMA was 122.133. Can anyone please advise what is the reason for the discrepancy ?

I also compared EMA values on the chart with iMA calculation, and they are different as well. I am testing this on a demo account. Please help. Many thanks.

Novalight

 

If back-tester: Bar-0 info for other timeframes or symbols is estimated or non-existent.

If live: then the difference could be due to ticks coming in.

Reason: