I actually want to calculate exponential weighted coefficient of variation. The market volatility is related with normal coefficient of variation. Now I want to see if it is more volatile with more recent price change.
hist_spy = data.history(spy, 'price', 30 , '1m')
std = hist.std()
mean = hist.mean()
cov = std/mean
Could anyone give me some hints to build a weighted one?