]> Piment Noir Git Repositories - freqai-strategies.git/commit
fix(quickadapter): sample PnL momentum per candle (#117)
authorJérôme Benoit <jerome.benoit@piment-noir.org>
Sun, 26 Jul 2026 16:38:29 +0000 (18:38 +0200)
committerGitHub <noreply@github.com>
Sun, 26 Jul 2026 16:38:29 +0000 (18:38 +0200)
commitc53079356b84291dc31072eac40c96071174179c
tree477b75662a4e70057b0973d35cad7ec4a7565560
parent224e51106d17695428861a6fe7e367d47389570d
fix(quickadapter): sample PnL momentum per candle (#117)

Sample the take-profit declining-PnL momentum gate once per candle instead of
per callback throttle, so velocity/acceleration are computed on a
candle-uniform series.

- Window sizing: ceil(30/tf)+1 samples (>=30 min velocity span on any
  timeframe), floored to 4 so both velocity and acceleration t-statistics are
  computable; warn when the nominal window is floored.
- Warm-up: fail open (never block a profitable take-profit exit) until a full
  momentum window is available.
- Persist a candle-date and timeframe marker with the PnL history; reset the
  series on legacy-history migration, timeframe change, or a candle
  discontinuity (forward gap or backward/non-monotonic date), persisting the
  reset before the append re-read.
- Fail open when the last candle lacks a valid date rather than gating on a
  stale series.
- Dedupe the take-profit order tag into a helper; type the trade history via a
  TypedDict.
quickadapter/user_data/strategies/QuickAdapterV3.py