From 356d79b38aabf37547b1e45d25e4f5c7ecb21d7e Mon Sep 17 00:00:00 2001 From: Wagner Costa Santos Date: Thu, 3 Nov 2022 13:27:56 -0300 Subject: [PATCH] verify mean and std exists in model metadata --- freqtrade/freqai/data_kitchen.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/freqtrade/freqai/data_kitchen.py b/freqtrade/freqai/data_kitchen.py index ec0503f0b..dbb25bf7d 100644 --- a/freqtrade/freqai/data_kitchen.py +++ b/freqtrade/freqai/data_kitchen.py @@ -981,8 +981,10 @@ class FreqaiDataKitchen: append_df[label] = predictions[label] if append_df[label].dtype == object: continue - append_df[f"{label}_mean"] = self.data["labels_mean"][label] - append_df[f"{label}_std"] = self.data["labels_std"][label] + if "labels_mean" in self.data: + append_df[f"{label}_mean"] = self.data["labels_mean"][label] + if "labels_std" in self.data: + append_df[f"{label}_std"] = self.data["labels_std"][label] append_df["do_predict"] = do_predict if self.freqai_config["feature_parameters"].get("DI_threshold", 0) > 0: