2018-01-28 07:38:41 +00:00
|
|
|
# pragma pylint: disable=missing-docstring, C0103
|
2017-12-28 14:58:02 +00:00
|
|
|
|
2018-01-28 07:38:41 +00:00
|
|
|
import pandas
|
2017-12-28 14:58:02 +00:00
|
|
|
import freqtrade.optimize
|
2018-01-10 07:51:36 +00:00
|
|
|
from freqtrade import analyze
|
2017-12-28 14:58:02 +00:00
|
|
|
|
|
|
|
_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
|