Beispiel #1
0
def get_ohlv(ticker, ms, ml):
    df = Bithumb.get_candlestick(ticker, chart_intervals="12h")
    df = df[['close']].copy()
    df['ma_s'] = df['close'].rolling(ms).mean().shift(1)
    df['ma_l'] = df['close'].rolling(ml).mean().shift(1)
    cond = (df['ma_s'] > df['ma_l'])
    df['status'] = np.where(cond, 1, 0)
    df.iloc[-1, -1] = 0

    if (df['status'][-2] == 0) & (df['status'][-1] == 1):
        return "지금이니"
    elif (df['status'][-2] == 1) & (df['status'][-1] == 0):
        return "팔아!"
    elif (df['status'][-2] == 1) & (df['status'][-1] == 1):
        return "홀딩해"
    elif (df['status'][-2] == 0) & (df['status'][-1] == 0):
        return "도망쳐"
Beispiel #2
0
def get_ohlv_MA(ticker):
    df = Bithumb.get_candlestick(ticker, chart_intervals="12h")

    return df