feat: strategy builder

This commit is contained in:
OpenSquared
2026-07-19 10:55:56 +02:00
parent 5d8bfa3371
commit 67952e01fa
5 changed files with 35 additions and 26 deletions

View File

@@ -33,7 +33,8 @@ def _score(priced: Dict[str, Any], legs: List[Dict[str, Any]], objective: str, s
def _passes_constraints(legs: List[Dict[str, Any]], priced: Dict[str, Any], constraints: Dict[str, Any]) -> bool:
if len(legs) > constraints["max_legs"]:
return False
if abs(priced["net_delta_now"]) > constraints["delta_threshold"]:
delta_threshold = constraints.get("delta_threshold")
if delta_threshold is not None and abs(priced["net_delta_now"]) > delta_threshold:
return False
if not priced["bounded_risk"]:
return False