From 36948e2a7480326a4bd786bc6ff72c2eb4c52fd5 Mon Sep 17 00:00:00 2001 From: initrv Date: Fri, 16 Dec 2022 14:14:05 +0300 Subject: [PATCH] fix base4 env done condition --- freqtrade/freqai/RL/Base4ActionRLEnv.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/freqtrade/freqai/RL/Base4ActionRLEnv.py b/freqtrade/freqai/RL/Base4ActionRLEnv.py index a3ebfdbfa..8f45028b1 100644 --- a/freqtrade/freqai/RL/Base4ActionRLEnv.py +++ b/freqtrade/freqai/RL/Base4ActionRLEnv.py @@ -88,7 +88,8 @@ class Base4ActionRLEnv(BaseEnvironment): {'price': self.current_price(), 'index': self._current_tick, 'type': trade_type}) - if self._total_profit < 1 - self.rl_config.get('max_training_drawdown_pct', 0.8): + if (self._total_profit < self.max_drawdown or + self._total_unrealized_profit < self.max_drawdown): self._done = True self._position_history.append(self._position)