feat: strategy builder
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user