From 6ecd92de4a8cdcccd364aa56098b3b4ba89f93de Mon Sep 17 00:00:00 2001 From: Robert Caulk Date: Mon, 3 Oct 2022 09:55:57 +0200 Subject: [PATCH] Allow updating without changing identifier --- freqtrade/freqai/data_drawer.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/freqtrade/freqai/data_drawer.py b/freqtrade/freqai/data_drawer.py index 0d3bdea29..603c477a0 100644 --- a/freqtrade/freqai/data_drawer.py +++ b/freqtrade/freqai/data_drawer.py @@ -294,6 +294,12 @@ class FreqaiDataDrawer: for return_str in rets: df[return_str].iloc[-1] = rets[return_str] + # this logic carries users between version without needing to + # change their identifier + if 'close_price' not in df.columns: + df['close_price'] = 0 + df['date_pred'] = 0 + df['close_price'].iloc[-1] = strat_df['close'].iloc[-1] df['date_pred'].iloc[-1] = strat_df['date'].iloc[-1]