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,11 +317,14 @@ class FreqaiDataKitchen:
tr_training_list.append(start.strftime("%Y%m%d") + "-" + stop.strftime("%Y%m%d")) tr_training_list.append(start.strftime("%Y%m%d") + "-" + stop.strftime("%Y%m%d"))
# associated backtest period # associated backtest period
timerange_backtest.startts = timerange_train.stopts
if timerange_backtest.stopts > config_timerange.stopts: if timerange_backtest.stopts > config_timerange.stopts:
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 timerange_backtest.stopts = timerange_backtest.startts + bt_period
start = datetime.datetime.utcfromtimestamp(timerange_backtest.startts) start = datetime.datetime.utcfromtimestamp(timerange_backtest.startts)
stop = datetime.datetime.utcfromtimestamp(timerange_backtest.stopts) stop = datetime.datetime.utcfromtimestamp(timerange_backtest.stopts)