import json
from eng import *
V = [
 (35, "26+27: SOL/BTC froth skip + 25% breadth", dict(solbtc_froth=0.20, breadth=0.25)),
 (36, "35 + skip if +60% in 30d", dict(solbtc_froth=0.20, breadth=0.25, froth_double=1.6)),
 (37, "35 + trail 7d low after half", dict(solbtc_froth=0.20, breadth=0.25, trail_after_half=7)),
 (38, "35 + all out day 13", dict(solbtc_froth=0.20, breadth=0.25, half=None, take_all_day=13)),
 (39, "35 + entry <=20% above breakout", dict(solbtc_froth=0.20, breadth=0.25, ext_cap=0.20)),
 (40, "35 with 20/10 windows", dict(solbtc_froth=0.20, breadth=0.25, nin=20, nout=10)),
 (41, "35, SOL/BTC threshold 15%", dict(solbtc_froth=0.15, breadth=0.25)),
 (42, "35, SOL/BTC threshold 25%", dict(solbtc_froth=0.25, breadth=0.25)),
 (43, "35, breadth 15%", dict(solbtc_froth=0.20, breadth=0.15)),
 (44, "35, breadth 35%", dict(solbtc_froth=0.20, breadth=0.35)),
 (45, "35 + 1 day late entry", dict(solbtc_froth=0.20, breadth=0.25, delay=1)),
 (46, "35 + 2% cost", dict(solbtc_froth=0.20, breadth=0.25, cost=0.02)),
]
R = {}
for i, nm, kw in V:
    r = evaluate(**kw); R[i] = dict(name=nm, kw=kw, **{k: v for k, v in r.items() if k != 'trades'})
    print("%2d %s" % (i, line(nm, r)), " sol", r['sol']['n'], r['sol']['pf'], "other", r['other']['n'], r['other']['pf'], flush=True)
json.dump(R, open('res_b.json', 'w'))
