]> Piment Noir Git Repositories - freqai-strategies.git/commit
fix: prevent division by zero in price_retracement_percent when prior range collapses
authorJérôme Benoit <jerome.benoit@piment-noir.org>
Mon, 12 Jan 2026 01:43:33 +0000 (02:43 +0100)
committerJérôme Benoit <jerome.benoit@piment-noir.org>
Mon, 12 Jan 2026 01:43:33 +0000 (02:43 +0100)
commit1958632739cf985b2e9b0c63b9a12ae4ce9edb10
tree10c9fa157af25405065c37148425b9e48c3f5228
parent20553583e29f51103526a12db5b5dc82f99471ef
fix: prevent division by zero in price_retracement_percent when prior range collapses

- Replace linear price change calculations with log-space formulas in top_change_percent, bottom_change_percent, and price_retracement_percent
- Add masked division with np.isclose() guard in price_retracement_percent to handle flat prior windows (returns 0.0 when denominator ≈ 0)
- Migrate zigzag amplitude and threshold calculations to log-space for numerical stability
- Remove normalization (x/(1+x)) from zigzag amplitude and speed metrics (now unbounded in log units)
- Update %-close_pct_change feature from pct_change() to log().diff() for consistency
- Bump version to 3.10.10
quickadapter/user_data/freqaimodels/QuickAdapterRegressorV3.py
quickadapter/user_data/strategies/QuickAdapterV3.py
quickadapter/user_data/strategies/Utils.py