Perhaps I am doing it wrong here, i am trying to do an algo based on the 200 moving average of the SPY.
Everyday at 15:45 the algo check is SPY is greater or lower than its 200 moving average day.
To calculate the 200 MA I use this function: movingAverageSPY = data.history(context.SPY, 'price', 200,'1d').mean()
What surprises me is how my 200 MA is a little off compared to the 200 MA on yahoo finance (sometimes by almost a dollar)...
Could it be due to the dividend?
Anybody had this issue??
Regards,
Remi