Any advice on writing a good volatility calculation function?
I wrote a function to use (high-low)/high to get it. But it seems not so good.
def volatility(context, data, stock, days):
low = min(data.history(stock, 'low', days, '1d'))
high = max(data.history(stock, 'high', days, '1d'))
return (high-low)/high