From 4f0e46e4e6f67e19d3b82e855f42ed54c09ecab4 Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=B4me=20Benoit?= Date: Wed, 4 Jun 2025 12:20:37 +0200 Subject: [PATCH] fix(qav3): find_fractals must return the dataframe indices MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Jérôme Benoit --- quickadapter/user_data/strategies/Utils.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/quickadapter/user_data/strategies/Utils.py b/quickadapter/user_data/strategies/Utils.py index 0c2cd95..943adf0 100644 --- a/quickadapter/user_data/strategies/Utils.py +++ b/quickadapter/user_data/strategies/Utils.py @@ -333,6 +333,8 @@ def find_fractals(df: pd.DataFrame, period: int = 2) -> tuple[list[int], list[in highs = df.get("high").to_numpy() lows = df.get("low").to_numpy() + indices = df.index.tolist() + fractal_highs = [] fractal_lows = [] @@ -347,9 +349,9 @@ def find_fractals(df: pd.DataFrame, period: int = 2) -> tuple[list[int], list[in ) if is_high_fractal: - fractal_highs.append(i) + fractal_highs.append(indices[i]) if is_low_fractal: - fractal_lows.append(i) + fractal_lows.append(indices[i]) return fractal_highs, fractal_lows -- 2.43.0