Beispiel #1
0
def test_emd():
    candles = np.array(mama_candles)

    single = ta.emd(candles)
    seq = ta.emd(candles, sequential=True)

    assert type(single).__name__ == 'EMD'
    assert round(single.middleband, 2) == 3.12
    assert round(single.upperband, 2) == 1.21
    assert round(single.lowerband, 2) == -0.28

    assert seq.middleband[-1] == single.middleband
    assert seq.upperband[-1] == single.upperband
    assert seq.lowerband[-1] == single.lowerband
    assert len(seq.middleband) == len(candles)
    assert len(seq.upperband) == len(candles)
    assert len(seq.lowerband) == len(candles)
Beispiel #2
0
def test_emd():
    candles = np.array(mama_candles)

    single = ta.emd(candles)
    seq = ta.emd(candles, sequential=True)

    assert type(single).__name__ == 'EMD'
    assert round(single.mean, 2) == 3.12
    assert round(single.up, 2) == 1.21
    assert round(single.low, 2) == -0.28

    assert seq.mean[-1] == single.mean
    assert seq.up[-1] == single.up
    assert seq.low[-1] == single.low
    assert len(seq.mean) == len(candles)
    assert len(seq.up) == len(candles)
    assert len(seq.low) == len(candles)