def calculateBollingerBandsValue(df):
simpleMovingAverage = pandas.rolling_mean(df,window=5)
stdDeviation = pandas.rolling_std(df,window=5)
bollingerBandsValue = (df - simpleMovingAverage)/(2*stdDeviation)
bollingerBandsValue = bollingerBandsValue.dropna()
return bollingerBandsValue
评论列表
文章目录