Hi Lance,
Here's a function that gives out the volatility (Standard Deviation):
def volatility(Data, lookback, what, where):
for i in range(len(Data)):
try:
Data[i, where] = (Data[i - lookback + 1:i + 1, what].std())
except IndexError:
pass
return Data
And if you want to use the Bollinger Bands using the above function, here's the article I've written on it: https://medium.com/ai-in-plain-english/a-new-modified-version-of-the-bollinger-bands-in-python-a616c25821b8