بنقرة واحدة
vix-scaled-risk-management
VIX-based position sizing, circuit breakers, and capital shift suppression
التثبيت باستخدام Codex أو Claude انسخ هذا Prompt والصقه في Codex أو Claude أو مساعد آخر ليراجع صفحة Skill ويثبّتها لك.
القائمة
VIX-based position sizing, circuit breakers, and capital shift suppression
التثبيت باستخدام Codex أو Claude انسخ هذا Prompt والصقه في Codex أو Claude أو مساعد آخر ليراجع صفحة Skill ويثبّتها لك.
استنادا إلى تصنيف SOC المهني
Normalize long-form CODEX cycle folders to short form before notebooks run. Trigger: cyc001_reg001_*, hard-coded cyc paths breaking, staged CODEX raw data failing in Notebooks 1/2.
v5.6.0 joint multi-TF model: single model per symbol with broadcast 1Hour context replaces dual 15Min/1Hour models. Trigger: (1) replacing weighted-voting model aggregation, (2) adding broadcast features to vectorized env, (3) limited training data + worried about overfitting from doubling obs_dim, (4) backtest builder mismatch with newer feature counts.
DEPRECATED in v5.6.0 — see joint-multi-tf-v560 skill. Documents the v5.2.0 dual-model approach (train separate 15Min/1Hour models, combine via weighted voting). Still relevant for: (1) loading legacy v5.5.0 dual models, (2) understanding the historical aggregation layer, (3) resampling pattern via origin='start'.
Surface a shipped-but-undocumented CLI feature in user-facing docs. Trigger: user reports a known feature missing from README/readthedocs even though the CLI command exists.
KINTSUGI Snakefile + CLI changes that route SLURM jobs around accounts saturated by OTHER users on the same QOS pool. Trigger: QOSGrpMemLimit, jobs stuck pending despite available GPU slots in config, noisy neighbor on shared QOS, multi-user investment pool exhaustion, _build_cycle_assignment static-vs-live.
KINTSUGI SLURM batch processing: Maximize throughput using multi-account resource calculation with GPU+CPU pools per account. Trigger: SLURM job submission, batch processing, resource maximization, GPU+CPU concurrent, headless processing, resource pool.
| name | vix-scaled-risk-management |
| description | VIX-based position sizing, circuit breakers, and capital shift suppression |
| author | Claude Code |
| date | "2026-02-24T00:00:00.000Z" |
| version | 4.4.0 |
| Item | Details |
|---|---|
| Date | 2026-02-24 |
| Goal | Add macro-aware risk scaling to position sizing, circuit breakers, and capital shifts |
| Environment | Python 3.11+, OpenBB FRED provider |
| Status | Success |
Position sizing had no macro awareness — during VIX=40 panic, positions were sized the same as VIX=12 calm. VIX spikes correlate with 40-60% of max drawdown events.
integrated_risk.py)Step 8 in calculate_position_size(), between correlation adjustment and capital limits:
# VIX regime scaling (linear interpolation within bands)
VIX < 15: scale = 1.00 (normal)
VIX 15-25: scale = 0.85 (elevated, linear)
VIX 25-35: scale = 0.65 (high, linear)
VIX > 35: scale = 0.40 (panic, linear)
IntegratedPositionSize.macro_risk_scale field tracks the applied scaleget_risk_summary() includes vix_level and macro_risk_scale_last_vix, _last_vix_scale) with refresh on each callrisk_monitor.py)# CircuitBreakerConfig additions
vix_warning_threshold = 30.0 # Warning alert
vix_critical_threshold = 40.0 # Circuit breaker alert
# RealTimeRiskMonitor.check_vix_level() -> List[RiskAlert]
capital_shift.py)# At top of should_shift_capital():
if vix > 30.0:
return False, "vix_suppressed"
# Prevents shifting equity capital to crypto during correlated panic
| Attempt | Why it Failed | Lesson Learned |
|---|---|---|
| Fixed VIX thresholds (step function) | Abrupt position size jumps at boundaries | Linear interpolation within bands is smoother |
Patching at integrated_risk.get_openbb_provider | Module-level lazy import not found | Must patch at alpaca_trading.data.openbb_provider.get_openbb_provider |
# VIX bands and scales
VIX_BANDS = [(15, 1.0), (25, 0.85), (35, 0.65), (float('inf'), 0.40)]
# Circuit breaker thresholds
VIX_WARNING = 30.0
VIX_CRITICAL = 40.0
# Capital shift suppression
VIX_SHIFT_SUPPRESS = 30.0
| File | Change |
|---|---|
alpaca_trading/risk/integrated_risk.py | VIX scaling in calculate_position_size() Step 8 |
alpaca_trading/risk/risk_monitor.py | check_vix_level() method, CircuitBreakerConfig fields |
alpaca_trading/risk/capital_shift.py | VIX suppression at top of should_shift_capital() |
tests/test_openbb_integration.py | 15 tests for VIX scaling, circuit breaker, suppression |