"""QE-CONTRACT-01/1.0: invented numerical counterexamples, no operational data.""" import argparse,json from pathlib import Path def examples(): notional=8000; rate_fraction=0.0001 wrong_fast=notional*rate_fraction/100 wrong_slow=sum(80*rate_fraction/100 for _ in range(100)) price_before,price_start,price_end=100,110,105 qty=10;initial=10000 inherited_start=initial-qty*price_before+qty*price_start inherited_end=initial-qty*price_before+qty*price_end return {'schema':'QE-CONTRACT-01/1.0','synthetic':True, 'units':{'notional_eur':notional,'fraction_per_side':rate_fraction, 'declared_bps_per_side':1,'expected_cost_eur':notional*rate_fraction, 'wrong_fast_eur':wrong_fast,'wrong_slow_eur':wrong_slow, 'lesson':'Numerical agreement does not validate the commission unit.'}, 'boundary':{'prices':[price_before,price_start,price_end],'quantity':qty, 'continuous_equity_start':inherited_start,'continuous_equity_end':inherited_end, 'calendar_pnl':inherited_end-inherited_start, 'calendar_return_pct':100*(inherited_end/inherited_start-1), 'cohort_pnl_since_entry':qty*(price_end-price_before), 'empty_no_new_signal_pnl':0,'costs_assumed':0, 'lesson':'Same price path: calendar change, entry-cohort result and a fresh empty account answer different questions.'}, 'maturity':{'closed_trade_profits':[20,30],'open_mtm':[-80,-90,-60], 'realised':50,'unrealised':-230,'total_mtm_pnl':-180, 'initial_equity':10000,'final_equity':9820, 'lesson':'Open positions are marked at the cutoff, not treated as zero or as final realised outcomes.'}, 'neighbours':{'A':[10,-3,-4,1,-2],'B':[4,3,2,4,3], 'rule':'Five declared settings each; index 0 is the initial choice. These are invented dependent observations, not independent evidence or a probability of future profit.'}} def main(): p=argparse.ArgumentParser(description=__doc__);p.add_argument('--out',type=Path);a=p.parse_args() text=json.dumps(examples(),indent=2)+'\n' if a.out: with a.out.open('x',encoding='utf-8') as f:f.write(text) else:print(text,end='') if __name__=='__main__':main()