My bollinger band comes out like the below, which doesn't seem right. Any idea what is wrong with my code for calculating upper and lower bollinber bands?
I obtained my data from here
start, end = dt.datetime(1976, 1, 1), dt.datetime(2013, 12, 31) sp = web.DataReader('^GSPC','yahoo', start, end) here are my bollinger calculations
calculation for bollinger band
ave = pd.stats.moments.rolling_mean(self[name], window) std = pd.stats.moments.rolling_std(self[name], window) self['upper'] = ave + (2 * std) self['lower'] = ave - (2 * std)