feat(core): Vol-of-Vol guard in validate_entry + tests
Blocca entry se |DVOL_now - DVOL_24h_ago| >= threshold (default 5 pt). Fail-open quando dvol_24h_ago è None (gap dati). Independente dal gate IV-RV: i due gate sono additivi. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -182,6 +182,20 @@ def validate_entry(ctx: EntryContext, cfg: StrategyConfig) -> EntryDecision:
|
||||
f"(IV-RV={ctx.iv_minus_rv} < {entry_cfg.iv_minus_rv_min} vol pts)"
|
||||
)
|
||||
|
||||
# §4-quater roadmap: vol-of-vol guard. Blocca entry quando il
|
||||
# regime di volatilità sta cambiando bruscamente, anche se IV-RV
|
||||
# è alto. Fail-open su gap dati 24h fa.
|
||||
if (
|
||||
entry_cfg.vol_of_vol_guard_enabled
|
||||
and ctx.dvol_24h_ago is not None
|
||||
):
|
||||
delta = abs(ctx.dvol_now - ctx.dvol_24h_ago)
|
||||
if delta >= entry_cfg.vol_of_vol_threshold_pt:
|
||||
reasons.append(
|
||||
f"DVOL shifted {delta} pt in {entry_cfg.vol_of_vol_lookback_hours}h "
|
||||
f"(threshold {entry_cfg.vol_of_vol_threshold_pt})"
|
||||
)
|
||||
|
||||
return EntryDecision(accepted=not reasons, reasons=reasons)
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user