2017-12-28 14:58:02 +00:00
|
|
|
import pandas
|
|
|
|
|
|
|
|
from freqtrade import analyze
|
|
|
|
import freqtrade.optimize
|
|
|
|
|
|
|
|
_pairs = ['BTC_ETH']
|
|
|
|
|
2017-12-28 19:05:33 +00:00
|
|
|
|
2017-12-28 14:58:02 +00:00
|
|
|
def load_dataframe_pair(pairs):
|
2018-01-06 22:24:35 +00:00
|
|
|
ld = freqtrade.optimize.load_data(None, ticker_interval=5, pairs=pairs)
|
2017-12-28 14:58:02 +00:00
|
|
|
assert isinstance(ld, dict)
|
|
|
|
assert isinstance(pairs[0], str)
|
|
|
|
dataframe = ld[pairs[0]]
|
|
|
|
dataframe = analyze.analyze_ticker(dataframe)
|
|
|
|
return dataframe
|
|
|
|
|
2017-12-28 19:05:33 +00:00
|
|
|
|
2017-12-28 14:58:02 +00:00
|
|
|
def test_dataframe_load():
|
|
|
|
dataframe = load_dataframe_pair(_pairs)
|
|
|
|
assert isinstance(dataframe, pandas.core.frame.DataFrame)
|
|
|
|
|
2017-12-28 19:05:33 +00:00
|
|
|
|
2017-12-28 14:58:02 +00:00
|
|
|
def test_dataframe_columns_exists():
|
|
|
|
dataframe = load_dataframe_pair(_pairs)
|
2017-12-28 19:05:33 +00:00
|
|
|
assert 'high' in dataframe.columns
|
|
|
|
assert 'low' in dataframe.columns
|
2017-12-28 14:58:02 +00:00
|
|
|
assert 'close' in dataframe.columns
|