fix bug on backtest timerange

This commit is contained in:
robcaulk 2022-05-06 13:06:54 +02:00
parent 00ff0c9b91
commit 3020218096

View File

@ -317,10 +317,13 @@ 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
else:
timerange_backtest.stopts = timerange_backtest.startts + bt_period
start = datetime.datetime.utcfromtimestamp(timerange_backtest.startts)