feat: strategy builder

This commit is contained in:
OpenSquared
2026-07-19 10:23:02 +02:00
parent 0cf6a68d2d
commit 5d8bfa3371
3 changed files with 68 additions and 16 deletions

View File

@@ -51,7 +51,10 @@ def _evaluate(
if len(legs) > constraints["max_legs"] or len(legs) == 0:
return None
try:
priced = price_combo(legs, chain_slice, surface_now, surface_scenario, horizon_days, r, contract_size)
# precise=False: skips the dense near-strike refinement (see check_bounded_risk) —
# ranking/filtering hundreds of candidates only needs relative ordering, not the
# exact peak height. The single loaded candidate gets refined precision via /price.
priced = price_combo(legs, chain_slice, surface_now, surface_scenario, horizon_days, r, contract_size, precise=False)
except Exception:
return None
if not _passes_constraints(legs, priced, constraints):