3 Commits (f0baa48e7b66b9ef58eac71f237f691d6d4e6a1d)

Author SHA1 Message Date
I Luk Kim f0baa48e7b Revert paper trader scoring to compute_entry_score — fix 2025 trade loss
The _compute_score → v5 dispatch caused v5's hard gates to reject almost
all events (v5 requires specific direction/guidance combos). This killed
all 2025 trades in paper backtest.

Root cause: BacktestRunner and PaperTradingEngine use different flows.
BacktestRunner applies scoring AFTER engine selection (engines have
score_threshold_override=0.0 that bypasses score gates). But EventDetector
applied scoring BEFORE engine matching, causing v5's hard gates to reject
events that engines would have accepted.

Fix: revert to compute_entry_score for EventDetector. Score is ranking-only
in paper trading; engine gates (reaction_min, close_min, etc.) handle filtering.

The volume_ratio_20d fix and DB-first feature fix remain in place.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
5 months ago
I Luk Kim 2bb5fe1c37 Fix paper trader / backtester consistency: DB-first features + config-aware scoring
Three critical inconsistencies between BacktestRunner and PaperTradingEngine
that caused gate fixes to not work in paper trading:

1. DB feature values now take priority over Oracle recalculation
   - Previously: Oracle bars always recomputed reaction_day_return etc.
   - Now: if DB feature_json has the value, Oracle fallback is skipped
   - Root cause of PII bug: DB had react=-5.3% but Oracle recomputed +13.9%
     due to different date alignment, bypassing engine reaction_min gate

2. Scoring now uses config's scoring_model (v5/v8/v9/v10 etc.)
   - Previously: always used compute_entry_score() regardless of config
   - Now: _compute_score() dispatches to the correct scoring function
   - Ensures hard gates and weights match between backtest and paper trading

3. volume_ratio_20d field name consistency (from prior commit)

These fixes ensure paper trading results match backtester behavior,
making engine gate changes (reaction_min, close_min, etc.) effective
in both systems.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
5 months ago
I Luk Kim 4de842ba89 Fix paper trader volume_ratio field name mismatch with selector
EventDetector computed volume_ratio as fallback but selector checks
volume_ratio_20d. When DB feature_json was missing this field, the
volume gate was silently bypassed in paper trading — allowing trades
like LKQ (vol=0.8) that the backtest correctly blocks.

Now sets both volume_ratio_20d and volume_ratio for consistency.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
5 months ago