Sizing Kelly · Vol · Corr
Pipeline Kelly fraccional (cap 0.25) → Volatility targeting → Correlation cap por portfolio.
Reporte fase 50_risk_management — OK
Archivos (en 213.165.80.157:/opt/trading-web/)
| Acción | Path | md5 |
|---|---|---|
| Pre-existente | risk.py |
30d7a90ca5566cc2ab2a9a147346cd19 |
| Editado | agents.py |
1a4ee4be79ceaea11939d3a9f8566cc9 |
| Editado | app.py |
af6f9e458e9be6a2629295b339cf922c |
| Editado | daily_report.py |
f591c9a9cf3d105d678a9503970f5207 |
Backups /opt/backups/trading-web/ (ts 20260418-1330)
trading.db.20260418-1330.bak(155 MB)agents.py.20260418-1330.bak,app.py.20260418-1330.bak,daily_report.py.20260418-1330.bak
Criterios
| Criterio | Resultado |
|---|---|
risk.py con 3 funciones (+ helpers) |
✅ smoke test all tests passed |
Schema predictions.kelly_size, risk_score |
✅ ya existente (phase 40) |
master_agent usa Kelly→VolTarget→CorrCap |
✅ vía _compute_sizing + size_pipeline |
Sección 14 en /report |
✅ línea 782 HTML — avg Kelly 0.00%, risk 82.3/100 |
Nuevas predicciones con kelly_size NOT NULL |
✅ 8 filas insertadas hoy post-deploy |
| Endpoints 200 | ✅ /, /report, /analyze |
investments intacta |
✅ 15 filas pre = 15 post |
Caveats honestos
- Kelly = 0 en todas las predicciones nuevas: con
confidencecalibrada (anti-cal raw→~0.5) y win_loss_ratio ≈ 1, el edge estimado es cero → el sistema rehúsa sizing. Comportamiento correcto dado el desempeño actual; no es un bug. - vol_annual se estima desde
atr_pct(ATR→σ≈1.5). Proxy, no GARCH per-asset. - Correlation cap per-asset usa matriz vacía (penalty=1); el cap duro del 20% se aplica. Cap multiactivo entrará en juego cuando master_agent evalúe portafolios simultáneos.
- Full Kelly nunca se usa — fraction=0.25 hardcoded en prod.