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
|
2018-03-15 22:37:34 +00:00
|
|
|
|
2018-03-02 15:22:00 +00:00
|
|
|
from freqtrade.analyze import Analyze
|
2018-03-17 21:44:47 +00:00
|
|
|
from freqtrade.optimize import load_data
|
2018-03-24 17:11:21 +00:00
|
|
|
from freqtrade.strategy.resolver import StrategyResolver
|
2017-12-28 14:58:02 +00:00
|
|
|
|
2018-02-03 16:15:40 +00:00
|
|
|
_pairs = ['ETH/BTC']
|
2017-12-28 14:58:02 +00:00
|
|
|
|
2017-12-28 19:05:33 +00:00
|
|
|
|
2017-12-28 14:58:02 +00:00
|
|
|
def load_dataframe_pair(pairs):
|
2018-03-24 09:21:59 +00:00
|
|
|
ld = load_data(None, ticker_interval='5m', pairs=pairs)
|
2017-12-28 14:58:02 +00:00
|
|
|
assert isinstance(ld, dict)
|
|
|
|
assert isinstance(pairs[0], str)
|
|
|
|
dataframe = ld[pairs[0]]
|
2018-03-02 13:46:32 +00:00
|
|
|
|
2018-03-24 19:44:04 +00:00
|
|
|
analyze = Analyze({'strategy': 'DefaultStrategy'})
|
2017-12-28 14:58:02 +00:00
|
|
|
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():
|
2018-03-24 19:44:04 +00:00
|
|
|
StrategyResolver({'strategy': 'DefaultStrategy'})
|
2017-12-28 14:58:02 +00:00
|
|
|
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():
|
2018-03-24 19:44:04 +00:00
|
|
|
StrategyResolver({'strategy': 'DefaultStrategy'})
|
2017-12-28 14:58:02 +00:00
|
|
|
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
|