feat(dashboard): Deribit-only book panel (TP01+SKH01) + accumulation forecast
New section showing the executable Deribit-only book (TP01 75% + SKH01 25%): combined FULL/HOLD Sharpe+DD, plus the reinvest-winnings accumulation projection (historical & conservative CAGR, €5k→5y/10y, conservative €/day run-rate). Reuses the already-computed sleeve daily series (no extra heavy compute). Honest caveats (bull sample, no leverage, SKH01 not live, ~€177k for €50/day). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
+32
-1
@@ -32,6 +32,21 @@ def build():
|
||||
pf = StrategyPortfolio(active_sleeves(), capital=2000.0)
|
||||
bt = pf.backtest()
|
||||
eq = bt["equity"]; idx = bt["index"]
|
||||
# BOOK DERIBIT-ONLY eseguibile (TP01 75% + SKH01 25%), riusando i daily gia' calcolati
|
||||
try:
|
||||
sl_by = {s.name: s for s in pf.sleeves}
|
||||
tp_d, sk_d = sl_by["TP01_trend_1d"].daily(), sl_by["SKH01_skyhook"].daily()
|
||||
Jd = pd.concat({"t": tp_d, "s": sk_d}, axis=1, join="inner").fillna(0.0)
|
||||
der = 0.75 * Jd["t"] + 0.25 * Jd["s"]
|
||||
mm = ((1.0 + der).resample("ME").prod() - 1.0).dropna()
|
||||
d_cagr = float(np.prod(1.0 + mm.values) ** (12.0 / len(mm)) - 1.0) if len(mm) else 0.0
|
||||
cons = d_cagr * 0.5
|
||||
rd = (1.0 + cons) ** (1.0 / 365.0) - 1.0 if cons > 0 else 0.0
|
||||
deribit = dict(full=metrics(der), hold=metrics(der[der.index >= HOLDOUT]),
|
||||
cagr=d_cagr, cons_cagr=cons, eday_5k=5000.0 * rd,
|
||||
eq5_5y=5000.0 * (1.0 + cons) ** 5, eq5_10y=5000.0 * (1.0 + cons) ** 10)
|
||||
except Exception as e:
|
||||
deribit = {"error": f"{type(e).__name__}: {e}"}
|
||||
# sparkline: subsample ~400 punti
|
||||
step = max(1, len(eq) // 400)
|
||||
spark = [(str(idx[i].date()), float(eq[i])) for i in range(0, len(eq), step)]
|
||||
@@ -56,7 +71,7 @@ def build():
|
||||
full=bt["full"], holdout=bt["holdout"], weights=bt["weights"],
|
||||
per_sleeve=bt["per_sleeve"], yearly=bt["yearly"],
|
||||
positions=pf.current_positions(), spark=spark, paper=paper, prevday=prevday,
|
||||
combo=combo, gtaa_weights=gtaa_w,
|
||||
combo=combo, gtaa_weights=gtaa_w, deribit=deribit,
|
||||
shadow=shadow, trades=trades, bh=None,
|
||||
)
|
||||
_CACHE.update(t=time.time(), data=data)
|
||||
@@ -146,6 +161,18 @@ def html():
|
||||
+ f" <span style='color:#8a93a0'>(asof {asof})</span>")
|
||||
else:
|
||||
gw_html = "n/d (cache ETF assente — gira fetch_ib_equities.py)"
|
||||
db = d.get("deribit")
|
||||
if db and "error" not in db:
|
||||
f2, h2 = db["full"], db["hold"]
|
||||
deribit_html = (
|
||||
f"FULL <b>Sh {f2['sharpe']:.2f}</b> ret {f2['ret']*100:+.0f}% DD {f2['maxdd']*100:.1f}% · "
|
||||
f"HOLD-OUT <b>Sh {h2['sharpe']:.2f}</b> DD {h2['maxdd']*100:.1f}%<br>"
|
||||
f"<span style='color:#8a93a0;font-size:13px'>accumulo (reinvesti le vincite, no leva) — CAGR storico "
|
||||
f"<b>{db['cagr']*100:.0f}%</b>, conservativo <b>{db['cons_cagr']*100:.0f}%</b>: "
|
||||
f"da €5k → ~€{db['eq5_5y']:,.0f} (5a) / ~€{db['eq5_10y']:,.0f} (10a) · "
|
||||
f"run-rate oggi ~<b>€{db['eday_5k']:.2f}/g</b> @conservativo</span>")
|
||||
else:
|
||||
deribit_html = "n/d" + (f" — {db['error']}" if db and db.get("error") else "")
|
||||
sh = d.get("shadow")
|
||||
if sh and "error" not in sh:
|
||||
bits = " · ".join(
|
||||
@@ -221,6 +248,10 @@ th{{color:#8a93a0;font-weight:500}}.y{{display:inline-block;background:#161b22;b
|
||||
<div class=box><b>TP01 (Deribit) + GTAA (IB)</b> — le DUE gambe ESEGUIBILI a basso capitale, scorrelate (corr ~0.21) → blend Sharpe ~1.5, drawdown dimezzato. <b>Nessuna esecuzione reale</b>:<br>{combo_html}<br>
|
||||
<span style="color:#8a93a0;font-size:13px">posizioni azionabili IB (GTAA, peso ETF):</span> {gw_html}</div>
|
||||
<p class=warn>⚠️ PAPER cross-venue: valida l'operativita' su due conti (Deribit + IB) a rischio zero. Lo Sharpe ~1.5 e' ottimistico (finestra crypto corta/favorevole); il dato robusto e' la diversificazione (corr 0.21, DD dimezzato), non il livello. XS01/VRP01 esclusi (STAT-MODE): qui solo TP01+GTAA.</p>
|
||||
<div class="section">BOOK DERIBIT-ONLY — eseguibile (TP01 + SKH01)</div>
|
||||
<div class=box><b>TP01 75% + SKH01 25%</b> — le due gambe direzionali BTC/ETH sullo STESSO venue (Deribit), ribilancio mensile. Sottoinsieme realmente armabile (XS01/VRP01 esclusi):<br>{deribit_html}<br>
|
||||
<span style="color:#8a93a0;font-size:13px">forecast: <code>scripts/portfolio/forecast_deribit_book.py</code> · report: <code>scripts/portfolio/run_deribit_book.py</code></span></div>
|
||||
<p class=warn>⚠️ Accumulo = proiezione condizionata (storico bull crypto → pianifica sul conservativo); nessuna leva; SKH01 research/forward-monitor (solo TP01 armato live). A €50/g servono ~€177k @conservativo: la via è capitale+tempo, non leva.</p>
|
||||
<div class="section">FORWARD-MONITOR — lead paper (non deploy)</div>
|
||||
<div class=box><b>PREVDAY range-breakout</b> — lead ORTOGONALE a TP01 (corr ~0.15 full / ~0 hold; marginal ADDS, non-hedge, robusto allo shift del confine-giorno). Forward-only, <b>nessuna esecuzione reale</b>:<br>{prevday_html}</div>
|
||||
<p class=warn>⚠️ LEAD in osservazione, NON deployato. Sopravvissuto alla verifica avversariale dell'onda intraday; lo teniamo in paper per validarlo fuori-campione-vero. I due libri (modeled vs real-$600) mostrano l'haircut di fill che lo scettico aveva segnalato.</p>
|
||||
|
||||
Reference in New Issue
Block a user