Bollinger bands calculation

Arvind
Please help to find the right formula for exponentially Bollinger upper and lower bands
  • Imran
    Imran edited May 2019
    def bolliger_band(df):

    df['mean'] = df['close'].rolling(20).mean()
    df['std'] = df['close'].rolling(20).std()

    df['upperband'] = df['mean'] + (df['std'] * 2)
    df['lowerband'] = df['mean'] - (df['std'] * 2)
    df = df.drop(['mean', 'std'], axis=1)
    return df

    simple bollinger band function.
  • Arvind
    Thanks @Imran
    Please help to find exponential Bollinger band
  • Arvind
    Only Moving average is exponential and SD is the usual formula!
Sign In or Register to comment.