Ejemplo n.º 1
0
    def dch():
        dch = ta.donchian_channel_hband(close, n=20, fillna=False)
        dchi = ta.donchian_channel_hband_indicator(close, n=20, fillna=False)
        dcl = ta.donchian_channel_lband(close, n=20, fillna=False)
        dcli = ta.donchian_channel_lband_indicator(close, n=20, fillna=False)

        if close[-1] == dch[-1]:
            vot_status_dc = "DCH Signals is: Strong Sell"
        elif dch[-1] > close[-1] > dch[-1] - 2:
            vot_status_dc = "DCH Signals is: Sell"
        elif dcl[-1] == close[-1]:
            vot_status_dc = "DCH Signals is: Strong Buy"
        elif dcl[-1] < close[-1] <= dcl[-1] + 2:
            vot_status_dc = "DCH Signals is: Buy"
        else:
            vot_status_dc = "DCH Signals is: Hold"
        return vot_status_dc
def process_data(data):
    data['BB_5'] = ta.bollinger_mavg(
        data['CLOSE'], 5)  #bollinger_moving average 5 trading periods
    data['BB_10'] = ta.bollinger_mavg(
        data['CLOSE'], 10)  #bollinger_moving average 10 trading periods
    data['BB_20'] = ta.bollinger_mavg(
        data['CLOSE'], 20)  # bollinger_moving average 20 periods
    data['ADX'] = ta.adx(data['HIGH'], data['LOW'], data['CLOSE'],
                         14)  #Average Directional Index
    data['ATR'] = ta.average_true_range(data['HIGH'], data['LOW'],
                                        data['CLOSE'], 14)  #Average True Range
    data['CCI'] = ta.cci(data['HIGH'], data['LOW'], data['CLOSE'],
                         14)  #Commodity Channel Index
    data['DCH'] = ta.donchian_channel_hband(
        data['CLOSE'])  #Donchian Channel High Band
    data['DCL'] = ta.donchian_channel_lband(
        data['CLOSE'])  #Donchian Channel Low Band
    data['DPO'] = ta.dpo(data['CLOSE'])  #Detrend Price Oscilator
    data['EMAf'] = ta.ema_fast(
        data['CLOSE'])  #Expornential Moving Average fast
    data['EMAs'] = ta.ema_slow(
        data['CLOSE'])  #Expornential Moving Average slow
    data['FI'] = ta.force_index(
        data['CLOSE'],
        data['VOLUME'])  # Force Index(reveals the value of a trend)
    data['ICHa'] = ta.ichimoku_a(data['HIGH'], data['LOW'])  #Ichimoku A
    data['ICHb'] = ta.ichimoku_b(data['HIGH'], data['LOW'])  #Ichimoku B
    data['KC'] = ta.keltner_channel_central(
        data['HIGH'], data['LOW'], data['CLOSE'])  #Keltner channel(KC) Central
    data['KST'] = ta.kst(
        data['CLOSE']
    )  #KST Oscillator (KST) identify major stock market cycle junctures
    data['MACD'] = ta.macd(
        data['CLOSE'])  # Moving Average convergence divergence
    data['OBV'] = ta.on_balance_volume_mean(
        data['CLOSE'], data['VOLUME'])  # on_balance_volume_mean
    data['RSI'] = ta.rsi(data['CLOSE'])  # Relative Strength Index (RSI)
    data['TRIX'] = ta.trix(
        data['CLOSE']
    )  #Shows the percent rate of change of a triple exponentially smoothed moving average
    data['TSI'] = ta.tsi(data['CLOSE'])  #True strength index (TSI)
    data['ROC1'] = (data['CLOSE'] - data['OPEN']) / data['OPEN']
    data['RET'] = data['CLOSE'].pct_change()
    data['y'] = np.where(data['OPEN'] <= data['CLOSE'], 1, -1)
    data = data.dropna()
    return data
Ejemplo n.º 3
0
    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"],
                                 df["Low"],
                                 df["Close"],
                                 df["Volume BTC"])
ta_df['OBV'] = ta.on_balance_volume(df["Close"],
                                    df["Volume BTC"])
ta_df['OBVM'] = ta.on_balance_volume_mean(
    df["Close"],
    df["Volume BTC"])
ta_df['CMF'] = ta.chaikin_money_flow(df["High"],
                                     df["Low"],
                                     df["Close"],