Jump to content
  • 0

How is EMA50 and EMA200 being calculated on the charts as it looks non-standard?


mgwuk

Question

I downloaded historical data from the US 500 via the API. I verified that the 320 data points I downloaded match the UI on the graph. When I calculate the EMA50 and EMA200 on my dataset correctly I get a different result to what is shown on the IG charts. I thought it may a precision difference that could cause the small difference I'm seeing but I checked that and that looks okay to me. I checked my dataset and it's clean without missing data.

I'm doing my calculation in Python as follows:

# Apply the exponential moving averages
df_ta["ema50"] = df_ta["close"].ewm(span=50, adjust=False).mean()
df_ta["ema200"] = df_ta["close"].ewm(span=200, adjust=False).mean()


Just for interest sake I checked the SMA50 and SMA200 and they are an exact match.

There is something strange about the EMA calculation on the charts. Does anyone know what it is?
 

Link to comment

0 answers to this question

Recommended Posts

There have been no answers to this question yet

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...
us