]> Piment Noir Git Repositories - freqai-strategies.git/commit
fix(quickadapter): make causal k-NN weight availability exact (#151)
authorJérôme Benoit <jerome.benoit@piment-noir.org>
Wed, 29 Jul 2026 13:57:20 +0000 (15:57 +0200)
committerGitHub <noreply@github.com>
Wed, 29 Jul 2026 13:57:20 +0000 (15:57 +0200)
commit4690e87c6ea89a97f841e79788d45d4bb6bdef0f
tree4910ec9a9546145bc2ac37c89e070036c2f57929
parent496bad9483f3e5016cd8b04328808dc21a9a4872
fix(quickadapter): make causal k-NN weight availability exact (#151)

Make the causal availability of the label-WEIGHT column exact for adaptive
k-NN Gaussian-fill bandwidths. Compute production 1D k-th-neighbor distances in
O(M log M), and propagate the earliest complete confirmation group at which each
clipped k-NN sigma is provably stable, over the confirmable Zigzag suffix
geometry: a confirmed pivot needs at least five slope observations, so
successive pivots are at least six candles apart and the last future candidate
is n-6. Initial-orientation replay is handled atomically via a position-only
successor bound (last replayed pivot + 6); later groups use the exact
confirmation frontier. Floor/ceiling/interior/singleton stability is decided on
the effective rank min(k, pivot_count-1) jointly with that geometry.

Truncate causal Gaussian fills to the finite support ceil(4*fill_sigma_candles)
tracked by availability; causal_mode=false keeps the legacy dense unbounded
Gaussian bit-identical. Pure-Gaussian uniform pivot centers keep their own label
availability (fixed, constant-clipped, adaptive); only adaptive off-center bands
additionally wait for sigma availability. Thread each label column's
weighting_config to availability.

Add the first quickadapter test harness, locking the Zigzag geometry invariants
the availability proof relies on (min pivot spacing, first-future bound, k-NN
availability bounds), runnable in the freqtrade container.

Fixes #131
README.md
quickadapter/user_data/strategies/QuickAdapterV3.py
quickadapter/user_data/strategies/Utils.py
quickadapter/user_data/strategies/tests/test_causal_weight_availability.py [new file with mode: 0644]