stable/freqtrade/tests/test_dataframe.py

35 lines
962 B
Python
Raw Normal View History

2018-01-28 07:38:41 +00:00
# pragma pylint: disable=missing-docstring, C0103
2018-01-28 07:38:41 +00:00
import pandas
from freqtrade.optimize import load_data
2018-03-02 15:22:00 +00:00
from freqtrade.analyze import Analyze
from freqtrade.strategy.strategy import Strategy
_pairs = ['BTC_ETH']
def load_dataframe_pair(pairs):
ld = load_data(None, ticker_interval=5, pairs=pairs)
assert isinstance(ld, dict)
assert isinstance(pairs[0], str)
dataframe = ld[pairs[0]]
analyze = Analyze({'strategy': 'default_strategy'})
dataframe = analyze.analyze_ticker(dataframe)
return dataframe
def test_dataframe_load():
Strategy({'strategy': 'default_strategy'})
dataframe = load_dataframe_pair(_pairs)
assert isinstance(dataframe, pandas.core.frame.DataFrame)
def test_dataframe_columns_exists():
Strategy({'strategy': 'default_strategy'})
dataframe = load_dataframe_pair(_pairs)
assert 'high' in dataframe.columns
assert 'low' in dataframe.columns
assert 'close' in dataframe.columns