]> Piment Noir Git Repositories - freqai-strategies.git/commitdiff
refactor(quickadapter): use ndarray.size instead of len() for array length
authorJérôme Benoit <jerome.benoit@piment-noir.org>
Mon, 26 Jan 2026 20:50:42 +0000 (21:50 +0100)
committerJérôme Benoit <jerome.benoit@piment-noir.org>
Mon, 26 Jan 2026 20:50:42 +0000 (21:50 +0100)
quickadapter/user_data/strategies/QuickAdapterV3.py

index 4828c77e625df45f459cdf1e6318aaa7c499c8b8..2c28d24dc7fbf0cd9eb26f6fdb10e697daf0ba9a 100644 (file)
@@ -1833,7 +1833,7 @@ class QuickAdapterV3(IStrategy):
         """
         unrealized_pnl_history_array = np.asarray(unrealized_pnl_history, dtype=float)
 
-        if window_size > 0 and len(unrealized_pnl_history_array) > window_size:
+        if window_size > 0 and unrealized_pnl_history_array.size > window_size:
             unrealized_pnl_history_array = unrealized_pnl_history_array[-window_size:]
 
         velocity = np.diff(unrealized_pnl_history_array)