fix bug on backtest timerange

This commit is contained in:
robcaulk 2022-05-06 13:06:54 +02:00
parent a07057fd8e
commit 505dbf2dc6

View File

@ -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)