]> Piment Noir Git Repositories - freqai-strategies.git/commitdiff
fix(qav3): ensure trades opened with an expired model are closed
authorJérôme Benoit <jerome.benoit@piment-noir.org>
Fri, 7 Mar 2025 22:24:42 +0000 (23:24 +0100)
committerJérôme Benoit <jerome.benoit@piment-noir.org>
Fri, 7 Mar 2025 22:24:42 +0000 (23:24 +0100)
Signed-off-by: Jérôme Benoit <jerome.benoit@piment-noir.org>
quickadapter/user_data/strategies/QuickAdapterV3.py

index cea1349e805597c010df2eb68ee84fa68a586be7..d65c04a408a11b9346a77fac23379402b2dac1a7 100644 (file)
@@ -337,6 +337,10 @@ class QuickAdapterV3(IStrategy):
             return "outlier_detected"
 
         enter_tag = trade.enter_tag
+        if (enter_tag == "long" or enter_tag == "short") and last_candle[
+            "do_predict"
+        ] == 2:
+            return "model_expired"
         if (
             enter_tag == "short"
             and last_candle["do_predict"] == 1