Hi, I am trying to do something simple here - calculate volatility. 

in onData i have this set of codes but i am getting an error. Not sure what i am doing wrong since the self.History returns a dataframe.

history = self.History("ZIV", 30, Resolution.Daily)
close = history["close"].unstack(level=0).pct_change().dropna()
volatility = close.std(ddof=1) 

 

Author