freqtrade_origin/freqtrade/tests/test_optimize_backtesting.py

17 lines
542 B
Python

# pragma pylint: disable=missing-docstring,W0212
from freqtrade import exchange, optimize
from freqtrade.exchange import Bittrex
from freqtrade.optimize.backtesting import backtest
def test_backtest(default_conf, mocker):
mocker.patch.dict('freqtrade.main._CONF', default_conf)
exchange._API = Bittrex({'key': '', 'secret': ''})
data = optimize.load_data(ticker_interval=5, pairs=['BTC_ETH'])
results = backtest(default_conf, optimize.preprocess(data), 10, True)
num_resutls = len(results)
assert num_resutls > 0