Files
foxhunt/crates
jgrusewski 7ed4e5ca90 fix: reward v6 — ATR vol proxy, tanh squash, loss aversion ordering, remove double penalty
Five reward computation fixes in experience_env_step CUDA kernel:

1. Replace CUSUM vol proxy with ATR(14): CUSUM at feature[41] is a binary
   direction indicator [-1,1,0], NOT volatility. When CUSUM≈0, vol_proxy
   became 0.0001 causing 10000x reward amplification. ATR(14) at feature[9]
   is actual realized volatility — reverse the safe_normalize encoding
   (ln(atr)+7)/16 to recover atr_pct = exp(norm*16-7) / price.

2. Move loss aversion BEFORE squash: previously applied after hard clamp,
   creating asymmetric [-15, +10] range making expected reward negative
   even for fair strategies. Now applied pre-squash for smooth asymmetry.

3. Replace hard clamp with tanh soft squash: fmaxf(-10, fminf(10, reward))
   destroyed tail information (1% and 5% wins both → 10.0). tanh preserves
   that larger wins produce proportionally larger rewards.

4. Remove turnover penalty: the 0.05*|delta|/max_position penalty double-
   counted transaction costs already deducted from cash via Almgren-Chriss
   impact model at line ~679, over-penalizing necessary rebalancing.

5. Clarify CUSUM spread_scale usage: CUSUM at feature[41] is correctly used
   as market-stress proxy for spread widening in tx cost computation — this
   is distinct from the (now-fixed) vol proxy for reward normalization.

Also: annotate min_hold_bars=5 as hyperopt candidate.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-25 01:42:41 +01:00
..