# Exploratory (post-hoc, NOT in family): can a deeper-ITM option capture the spot edge of ORB with-gap + structural stop held to 15:14 (E1)? import sys; sys.path.insert(0,'/workspace/research/buyer-method-audit/scripts'); from lib import * from scipy import stats S,PC=load_spot(); opt(); X=pd.read_csv('results/signals_all.csv',parse_dates=['date']); X=X[(X.date>=pd.Timestamp('2024-10-21'))&X.cand.isin(['B15','B30'])] rows=[] for r in X.itertuples(): a=S[r.date]; spx=spot_proxy(a,r.m,r.dir,r.entry,r.stop,r.R,'E1') for so in (0,2,4,6): for cs in ('REAL','STRESS'): z=sim(a,r.date,r.m,r.dir,r.entry,r.stop,r.R,'E1',cs,strike_off=so) if z and z['status']=='ok': rows.append(dict(cand=r.cand,date=r.date,itm=so,scen=cs,split=split(r.date),spot=spx,gross=z['gross'],pnl=z['pnl'])) D=pd.DataFrame(rows); D.to_csv('results/deep_itm_orb_E1.csv',index=False) g=D.groupby(['cand','itm','scen','split']).agg(n=('pnl','size'),spot_pts=('spot','mean'),opt_gross=('gross','mean'),pnl=('pnl','mean')).round(2); print(g.to_string()); g.to_csv('results/deep_itm_orb_E1_summary.csv') SPX=pd.read_csv('results/spot_proxy.csv',parse_dates=['date']) for c in ('B15','B30'): v=SPX[(SPX.cand==c)&(SPX.ex=='E1')].spot_pts.dropna(); print(c,'spot E1 2022-26 n',len(v),'mean',round(v.mean(),2),'t-p',stats.ttest_1samp(v,0).pvalue)