avoid mutating new_trained_timerange

This commit is contained in:
robcaulk
2023-05-09 12:42:02 +00:00
parent 35ce88f1e5
commit 2c0230ba93

View File

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