From 3020218096593105e38ce8993068431bda4e3dac Mon Sep 17 00:00:00 2001 From: robcaulk Date: Fri, 6 May 2022 13:06:54 +0200 Subject: [PATCH] fix bug on backtest timerange --- freqtrade/freqai/data_kitchen.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/freqtrade/freqai/data_kitchen.py b/freqtrade/freqai/data_kitchen.py index 1bea97697..38d518e23 100644 --- a/freqtrade/freqai/data_kitchen.py +++ b/freqtrade/freqai/data_kitchen.py @@ -317,11 +317,14 @@ class FreqaiDataKitchen: tr_training_list.append(start.strftime("%Y%m%d") + "-" + stop.strftime("%Y%m%d")) # associated backtest period + + timerange_backtest.startts = timerange_train.stopts + if timerange_backtest.stopts > config_timerange.stopts: timerange_backtest.stopts = config_timerange.stopts - timerange_backtest.startts = timerange_train.stopts - timerange_backtest.stopts = timerange_backtest.startts + bt_period + else: + timerange_backtest.stopts = timerange_backtest.startts + bt_period start = datetime.datetime.utcfromtimestamp(timerange_backtest.startts) stop = datetime.datetime.utcfromtimestamp(timerange_backtest.stopts)