From: Jérôme Benoit Date: Mon, 26 Jan 2026 20:50:42 +0000 (+0100) Subject: refactor(quickadapter): use ndarray.size instead of len() for array length X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=b0d495b3790f6609f3ae7157831adfba5691aef1;p=freqai-strategies.git refactor(quickadapter): use ndarray.size instead of len() for array length --- diff --git a/quickadapter/user_data/strategies/QuickAdapterV3.py b/quickadapter/user_data/strategies/QuickAdapterV3.py index 4828c77..2c28d24 100644 --- a/quickadapter/user_data/strategies/QuickAdapterV3.py +++ b/quickadapter/user_data/strategies/QuickAdapterV3.py @@ -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)