feat(core): IV-RV adaptive gate in validate_entry + tests
Quando iv_minus_rv_adaptive_enabled=True, la soglia diventa max(P_q rolling, iv_minus_rv_min). Path legacy (statico) e None-bypass restano invariati. Aggiunge anche due model_validator a StrategyConfig per fail-fast su config invalida (window_min_days < target_days, percentile in (0,1)) — risponde alla code review T1. Tests: pass/skip su rolling, warmup hard, floor binding, backwards compat statico, None bypass. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -407,6 +407,16 @@ class StrategyConfig(BaseModel):
|
||||
if self.entry.dvol_min >= self.entry.dvol_max:
|
||||
raise ValueError("dvol_min must be < dvol_max")
|
||||
|
||||
e = self.entry
|
||||
if e.iv_minus_rv_window_min_days >= e.iv_minus_rv_window_target_days:
|
||||
raise ValueError(
|
||||
"iv_minus_rv_window_min_days must be < iv_minus_rv_window_target_days"
|
||||
)
|
||||
if not (Decimal("0") < e.iv_minus_rv_percentile < Decimal("1")):
|
||||
raise ValueError(
|
||||
"iv_minus_rv_percentile must be in (0, 1)"
|
||||
)
|
||||
|
||||
return self
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user