From c65a58338d485a4380f52546d0482150689d6001 Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=B4me=20Benoit?= Date: Sun, 16 Mar 2025 20:34:14 +0100 Subject: [PATCH] refactor(qav3): cleanup stoploss distance computation MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Jérôme Benoit --- quickadapter/user_data/strategies/QuickAdapterV3.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/quickadapter/user_data/strategies/QuickAdapterV3.py b/quickadapter/user_data/strategies/QuickAdapterV3.py index f1f2735..1ccd888 100644 --- a/quickadapter/user_data/strategies/QuickAdapterV3.py +++ b/quickadapter/user_data/strategies/QuickAdapterV3.py @@ -380,10 +380,8 @@ class QuickAdapterV3(IStrategy): def get_stoploss_distance( self, entry_price: float, entry_natr: float, leverage: float ) -> float: - stoploss_natr_distance = ( - entry_price * entry_natr * self.stoploss_natr_ratio - ) / leverage - return stoploss_natr_distance + stoploss_natr_distance = entry_price * entry_natr * self.stoploss_natr_ratio + return stoploss_natr_distance / leverage def custom_stoploss( self, -- 2.43.0