From: Jérôme Benoit Date: Thu, 27 Feb 2025 09:52:58 +0000 (+0100) Subject: fix(reforcexy): fix peak pnl computation X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=ed14b4523826a0aec4b64187b385ede1ea22a62a;p=freqai-strategies.git fix(reforcexy): fix peak pnl computation Signed-off-by: Jérôme Benoit --- 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: