"""SKH_P_LOCAL winner: ptn_n=45, sl_atr=2.5, tp_atr=7.0, uscitalong=24, uscitashort=16
(rest = V1). Beats V1 on DD (34% vs 49%), minHold (+0.81 vs +0.64), minFull (+0.83 vs +0.69),
and pushes clean-year(2025) uplift well over 0.02 -> robust_oos True (fully earns a slot)."""
from __future__ import annotations
import sys
sys.path.insert(0, "/opt/docker/PythagorasGoal/scripts/research/skyhook")
import skyhooklib as sk
from src.strategies.skyhook import SkyhookParams

V1 = dict(ptn_n=55, sl_atr=2.5, tp_atr=6.0, vola_lo=35.0, vola_hi=95.0, vol_lo=0.0)
WIN = SkyhookParams(**{**V1, **dict(ptn_n=45, sl_atr=2.5, tp_atr=7.0, uscitalong=24, uscitashort=16)})

rep = sk.study("SKH_P_LOCAL_winner", WIN)
print(sk.fmt(rep))
print("causality:", sk.causality(WIN, asset="BTC"), sk.causality(WIN, asset="ETH"))
mg = sk.marginal(WIN)
keys=("corr_full","corr_hold","marginal_verdict","has_insample_edge","is_hedge",
      "robust_oos","multicut_persistent","clean_year_uplift","jackknife_min_uplift",
      "cand_insample_sharpe","cand_full_sharpe","beta_to_tp01","alpha_ann")
print("marginal:", {k: mg.get(k) for k in keys})
print("blend w25 uplift_hold:", mg.get("blends",{}).get("w25",{}).get("uplift_hold"),
      "uplift_full:", mg.get("blends",{}).get("w25",{}).get("uplift_full"))
print("blend w50:", mg.get("blends",{}).get("w50"))
print("multicut:", mg.get("multicut_uplift"))
v=rep["verdict"]
print("\nVERDICT:", v)
