fix(dashboard): taglia del book letta dal conto, non cablata
Il cruscotto dichiarava "cap $300/asset · capitale reale ≈ $600" come testo fisso: sarebbe diventato falso al primo deposito, sulla pagina che si guarda per capire cosa sta girando. Ora legge equity reale + max_notional_per_asset_frac + disaster_sl_pct dalla config. Reso dinamico solo il testo di stato del book LIVE. I $600/$2000 restanti in dashboard.py sono i capitali d'inizio CONGELATI dei libri paper (forward-monitor): quelli devono restare fissi o le serie perdono continuita'. Verificato il percorso di ESECUZIONE: nessuna assunzione cablata sulla taglia da $600 (book.py / shadow.py / book_execute.py). Reso: "capitale reale $596.92 · cap $298/asset · disaster-SL on-book −30%". 391 test verdi. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
+17
-1
@@ -251,6 +251,22 @@ def html():
|
||||
f"TP01 target: {bits}<br>→ per gli ordini reali: <code>uv run python scripts/live/live_trend.py</code> (host)")
|
||||
else:
|
||||
shadow_html = "non disponibile" + (f" — {sh['error']}" if sh and sh.get('error') else "")
|
||||
|
||||
# Taglia del book LIVE: letta dal conto e dalla config, MAI cablata. Il testo cablato
|
||||
# "capitale reale ~$600 / cap $300" e' diventato falso al primo deposito (2026-07-26).
|
||||
try:
|
||||
import json as _json
|
||||
from src.live.book import CONFIG as _CFG
|
||||
_c = _json.loads(_CFG.read_text())
|
||||
_eq = (sh or {}).get("real_equity")
|
||||
_cap_txt = (f"cap ${_eq * float(_c['max_notional_per_asset_frac']):,.0f}/asset"
|
||||
if _eq and _c.get("max_notional_per_asset_frac")
|
||||
else f"cap ${float(_c.get('max_notional_per_asset_usd', 300)):,.0f}/asset")
|
||||
_eq_txt = f"capitale reale ${_eq:,.2f}" if _eq else "capitale reale non leggibile"
|
||||
live_size_html = (f"{_eq_txt} · {_cap_txt} · disaster-SL on-book "
|
||||
f"−{float(_c.get('disaster_sl_pct', 0.30))*100:.0f}%")
|
||||
except Exception:
|
||||
live_size_html = "taglia non leggibile"
|
||||
trows = ""
|
||||
for t in d.get("trades", []):
|
||||
cls = "g" if t["action"] == "ENTRY" else "r"
|
||||
@@ -306,7 +322,7 @@ th{{color:#8a93a0;font-weight:500}}.y{{display:inline-block;background:#161b22;b
|
||||
<div class="section live">① LIVE — Deribit mainnet (conto reale, sola lettura)</div>
|
||||
{_alerts_banner(d.get("book_alerts") or {})}
|
||||
<div class=box><b>Shadow TP01</b> (cosa farebbe ORA sul conto reale, nessun ordine inviato):<br>{shadow_html}</div>
|
||||
<p class=warn>Solo TP01 e' armato live (cap $300/asset · disaster-SL on-book −30% · capitale reale ≈ $600). SKH01/XS01/VRP01 = paper/stat-mode. Lo "Shadow" mostra il target reale ma NON invia ordini.</p>
|
||||
<p class=warn>Il book LIVE e' TP01+SKH01 nettati ({live_size_html}). XS01/VRP01 = paper/stat-mode. Lo "Shadow" mostra il target reale ma NON invia ordini.</p>
|
||||
|
||||
<div class="section">② TRADES ESEGUITI (reali) + frequenza operativa</div>
|
||||
<div class=box><b>Frequenza operativa</b> (contata sui dati certificati, non stimata):<br>{freq_html}</div>
|
||||
|
||||
Reference in New Issue
Block a user