]> Piment Noir Git Repositories - freqai-strategies.git/commitdiff
refactor(qav3): cleanup stoploss distance computation
authorJérôme Benoit <jerome.benoit@piment-noir.org>
Sun, 16 Mar 2025 19:34:14 +0000 (20:34 +0100)
committerJérôme Benoit <jerome.benoit@piment-noir.org>
Sun, 16 Mar 2025 19:34:14 +0000 (20:34 +0100)
Signed-off-by: Jérôme Benoit <jerome.benoit@piment-noir.org>
quickadapter/user_data/strategies/QuickAdapterV3.py

index f1f27358194d2a80543f6b58ba2f770d7be8135f..1ccd8882efbe990283a1f22fa1250a7c3a89401d 100644 (file)
@@ -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,