def addTechnicalAnalysisIndicators(self, df):
   ''' #bollinger indicators (1 or 0)
   df['bb_high_indicator'] = ta.bollinger_hband_indicator(close)
   df['bb_low_indicator'] = ta.bollinger_lband_indicator(close)'''
   
   close, high, low = self.close, self.high, self.low
   # rsi with time period (for 5 min intervals, n=12 -> 1 hour)
   df['rsi'] = ta.rsi(close, n=14)
   df['upperboll'] = ta.bollinger_hband(close, ndev=2, fillna=False)
   df['lowerboll'] = ta.bollinger_lband(close, ndev=2, fillna=False)
   df['lowerkelt'] = ta.keltner_channel_lband(high, low, close, n=10, fillna=False)
   df['upperkelt'] = ta.keltner_channel_hband(high, low, close, n=10, fillna=False)
   df['sma14'] = ta.bollinger_mavg(close, n=14)
   df['sma30'] = ta.bollinger_mavg(close, n=30)
   df['sma50'] = ta.bollinger_mavg(close, n=50)
   df['sma200'] = ta.bollinger_mavg(close, n=200)
   return df
Esempio n. 2
0
ta_df['BBL'] = ta.bollinger_lband(df["Close"])
ta_df['BBM'] = ta.bollinger_mavg(df["Close"])
ta_df['BBHI'] = ta.bollinger_hband_indicator(
    df["Close"])
ta_df['BBLI'] = ta.bollinger_lband_indicator(
    df["Close"])
ta_df['KCC'] = ta.keltner_channel_central(
    df["High"],
    df["Low"],
    df["Close"])
ta_df['KCH'] = ta.keltner_channel_hband(
    df["High"],
    df["Low"],
    df["Close"])
ta_df['KCL'] = ta.keltner_channel_lband(
    df["High"],
    df["Low"],
    df["Close"])
ta_df['KCHI'] = ta.keltner_channel_hband_indicator(df["High"],
                                                   df["Low"],
                                                   df["Close"])
ta_df['KCLI'] = ta.keltner_channel_lband_indicator(df["High"],
                                                   df["Low"],
                                                   df["Close"])
ta_df['DCH'] = ta.donchian_channel_hband(
    df["Close"])
ta_df['DCL'] = ta.donchian_channel_lband(
    df["Close"])
ta_df['DCHI'] = ta.donchian_channel_hband_indicator(df["Close"])
ta_df['DCLI'] = ta.donchian_channel_lband_indicator(df["Close"])

ta_df['ADI'] = ta.acc_dist_index(df["High"],