Hello all,
I have been using a certain code to calculate the current and previous simple moving averages of a specific timeframe...
Ex:
history = data.history(context.securities,'close',11,'1d')
sma10 = history[-10:].mean()
sma10prev = history[-11:-1].mean()
When I log the results, the sma10 seems to calculate and fluctuate, as expected, but the sma10prev stays on static value and never fluctuates.
I could have sworn I've run into this before and this method was working, but I don't know what I'm doing wrong now. If anyone can help...?
Thanks!!
Danny