]> Piment Noir Git Repositories - freqai-strategies.git/commitdiff
fix(qav3): rely on custom stoploss for trailing stop
authorJérôme Benoit <jerome.benoit@piment-noir.org>
Sun, 16 Mar 2025 18:44:57 +0000 (19:44 +0100)
committerJérôme Benoit <jerome.benoit@piment-noir.org>
Sun, 16 Mar 2025 18:44:57 +0000 (19:44 +0100)
Signed-off-by: Jérôme Benoit <jerome.benoit@piment-noir.org>
quickadapter/user_data/strategies/QuickAdapterV3.py

index ff21717e8e1cf77de950b7661adaf488707c5100..f1f27358194d2a80543f6b58ba2f770d7be8135f 100644 (file)
@@ -43,12 +43,12 @@ class QuickAdapterV3(IStrategy):
     timeframe = "5m"
 
     stoploss = -0.02
+    use_custom_stoploss = True
     # Trailing stop:
-    trailing_stop = True
+    trailing_stop = False
     trailing_stop_positive = 0.01
     trailing_stop_positive_offset = 0.011
     trailing_only_offset_is_reached = True
-    use_custom_stoploss = True
 
     @property
     def stoploss_natr_ratio(self) -> float:
@@ -394,6 +394,10 @@ class QuickAdapterV3(IStrategy):
         current_profit: float,
         **kwargs,
     ) -> float | None:
+        # Trailing stoploss starts at 1% profit
+        if current_profit < 0.01:
+            return None
+
         df, _ = self.dp.get_analyzed_dataframe(pair=pair, timeframe=self.timeframe)
 
         if df.empty: