extract backtesting abort functionality

This commit is contained in:
Matthias
2021-07-06 06:28:47 +02:00
parent 5474d5ee64
commit 005da97183
4 changed files with 33 additions and 9 deletions

View File

@@ -52,8 +52,8 @@ async def api_start_backtest(bt_settings: BacktestRequest, background_tasks: Bac
# TODO: Investigate if enabling protections can be dynamically ingested from here...
from freqtrade.optimize.backtesting import Backtesting
ApiServer._bt = Backtesting(btconfig)
# Reset data if backtesting is reloaded
# Only reload data if timeframe or timerange changed.
if (not ApiServer._backtestdata or not ApiServer._bt_timerange
or lastconfig.get('timerange') != btconfig['timerange']
or lastconfig.get('timeframe') != strat.timeframe):