From 2c0230ba9382ba5b08521bc21a810dc9a19478d7 Mon Sep 17 00:00:00 2001 From: robcaulk Date: Tue, 9 May 2023 12:42:02 +0000 Subject: [PATCH] avoid mutating new_trained_timerange --- freqtrade/freqai/freqai_interface.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/freqtrade/freqai/freqai_interface.py b/freqtrade/freqai/freqai_interface.py index f8d3d516c..8625d88ff 100644 --- a/freqtrade/freqai/freqai_interface.py +++ b/freqtrade/freqai/freqai_interface.py @@ -622,6 +622,8 @@ class IFreqaiModel(ABC): strategy, corr_dataframes, base_dataframes, pair ) + trained_timestamp = new_trained_timerange.stopts + buffered_timerange = dk.buffer_timerange(new_trained_timerange) unfiltered_dataframe = dk.slice_dataframe(buffered_timerange, unfiltered_dataframe) @@ -632,8 +634,8 @@ class IFreqaiModel(ABC): model = self.train(unfiltered_dataframe, pair, dk) - self.dd.pair_dict[pair]["trained_timestamp"] = new_trained_timerange.stopts - dk.set_new_model_names(pair, new_trained_timerange.stopts) + self.dd.pair_dict[pair]["trained_timestamp"] = trained_timestamp + dk.set_new_model_names(pair, trained_timestamp) self.dd.save_data(model, pair, dk) if self.plot_features: