How to use the technical.indicators.chaikin_money_flow function in technical

To help you get started, we’ve selected a few technical examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github freqtrade / technical / tests / test_util.py View on Github external
def test_resampled_merge_contains_indicator(testdata_1m_btc):
    resampled = resample_to_interval(testdata_1m_btc, 5)
    resampled['cmf'] = chaikin_money_flow(resampled, 5)
    merged = resampled_merge(testdata_1m_btc, resampled)

    print(merged)
    assert "resample_5_cmf" in merged
github freqtrade / technical / tests / test_indicators.py View on Github external
def test_chaikin_money_flow(testdata_1m_btc):
    from technical.indicators import cmf, chaikin_money_flow

    assert cmf is chaikin_money_flow

    result = chaikin_money_flow(testdata_1m_btc, 14)

    # drop nan, they are exspected, based on the period
    result = result[~numpy.isnan(result)]

    assert result.min() >= -1
    assert result.max() <= 1