From ed14b4523826a0aec4b64187b385ede1ea22a62a Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=B4me=20Benoit?= Date: Thu, 27 Feb 2025 10:52:58 +0100 Subject: [PATCH] fix(reforcexy): fix peak pnl computation MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Jérôme Benoit --- ReforceXY/user_data/freqaimodels/ReforceXY.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ReforceXY/user_data/freqaimodels/ReforceXY.py b/ReforceXY/user_data/freqaimodels/ReforceXY.py index 17b9a70..11c19d6 100644 --- a/ReforceXY/user_data/freqaimodels/ReforceXY.py +++ b/ReforceXY/user_data/freqaimodels/ReforceXY.py @@ -809,7 +809,7 @@ class ReforceXY(BaseReinforcementLearningModel): self._position in (Positions.Short, Positions.Long) and action == Actions.Neutral.value ): - peak_pnl = np.max(self.get_most_recent_peak_pnl(), pnl) + peak_pnl = max(self.get_most_recent_peak_pnl(), pnl) if peak_pnl > 0: drawdown_penalty = 0.01 * factor * (peak_pnl - pnl) else: -- 2.43.0