Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
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
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