From e7f72d52b8faddfc35ed27b1840aa6a2c3d69ea7 Mon Sep 17 00:00:00 2001 From: robcaulk Date: Wed, 30 Nov 2022 12:36:26 +0100 Subject: [PATCH] bring back market side setting in get_state_info --- freqtrade/freqai/RL/BaseReinforcementLearningModel.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/freqtrade/freqai/RL/BaseReinforcementLearningModel.py b/freqtrade/freqai/RL/BaseReinforcementLearningModel.py index e1381ab62..9d2fae583 100644 --- a/freqtrade/freqai/RL/BaseReinforcementLearningModel.py +++ b/freqtrade/freqai/RL/BaseReinforcementLearningModel.py @@ -193,6 +193,10 @@ class BaseReinforcementLearningModel(IFreqaiModel): now = datetime.now(timezone.utc).timestamp() trade_duration = int((now - trade.open_date_utc.timestamp()) / self.base_tf_seconds) current_profit = trade.calc_profit_ratio(current_rate) + if trade.is_short: + market_side = 0 + else: + market_side = 1 return market_side, current_profit, int(trade_duration)