]> Piment Noir Git Repositories - freqai-strategies.git/commitdiff
refactor(qav3): remove unneeded intermediate variable
authorJérôme Benoit <jerome.benoit@piment-noir.org>
Fri, 8 Aug 2025 15:49:08 +0000 (17:49 +0200)
committerJérôme Benoit <jerome.benoit@piment-noir.org>
Fri, 8 Aug 2025 15:49:08 +0000 (17:49 +0200)
Signed-off-by: Jérôme Benoit <jerome.benoit@piment-noir.org>
quickadapter/user_data/strategies/QuickAdapterV3.py

index 0b5c7e4fe72905d0b689d25fd319d986cce7b265..d0b433af99ca1b075a867235ee01211db08cd9a9 100644 (file)
@@ -1122,9 +1122,8 @@ class QuickAdapterV3(IStrategy):
                 trade.set_custom_data("n_outliers", n_outliers)
                 trade.set_custom_data("last_outlier_date", last_candle_date.isoformat())
 
-        trade_direction = trade.trade_direction
         if (
-            trade_direction == "short"
+            trade.trade_direction == "short"
             and last_candle.get("do_predict") == 1
             and last_candle.get("DI_catch") == 1
             and last_candle.get(EXTREMA_COLUMN) < last_candle.get("minima_threshold")
@@ -1132,7 +1131,7 @@ class QuickAdapterV3(IStrategy):
         ):
             return "minima_detected_short"
         if (
-            trade_direction == "long"
+            trade.trade_direction == "long"
             and last_candle.get("do_predict") == 1
             and last_candle.get("DI_catch") == 1
             and last_candle.get(EXTREMA_COLUMN) > last_candle.get("maxima_threshold")