Пример #1
0
def test_bullish_engulfing():
    set_up(500)

    candles = np.array(bullish_engulfing_candles)

    store.candles.batch_add_candle(candles, exchanges.SANDBOX, 'BTCUSD', timeframes.MINUTE_1)
    res = ta.engulfing(exchanges.SANDBOX, 'BTCUSD', timeframes.MINUTE_1)
    assert res == 0

    new_candle = np.array([1563411600000, 208.53, 212.77, 214.31, 208.53, 5739.5236321])
    store.candles.add_candle(new_candle, exchanges.SANDBOX, 'BTCUSD', timeframes.MINUTE_1)
    res = ta.engulfing(exchanges.SANDBOX, 'BTCUSD', timeframes.MINUTE_1)
    assert res == 1
Пример #2
0
def test_bearish_engulfing():
    set_up(500)

    candles = np.array(bearish_engulfing_candles)

    store.candles.batch_add_candle(candles, exchanges.SANDBOX, 'BTCUSD', timeframes.MINUTE_1)
    res = ta.engulfing(exchanges.SANDBOX, 'BTCUSD', timeframes.MINUTE_1)
    assert res == 0

    new_candle = np.array([1563472800000, 223.99, 222.84, 225.26, 222.5, 5777.43564279])
    store.candles.add_candle(new_candle, exchanges.SANDBOX, 'BTCUSD', timeframes.MINUTE_1)
    res = ta.engulfing(exchanges.SANDBOX, 'BTCUSD', timeframes.MINUTE_1)
    assert res == -1