feat(EXEC-001): add hedge strategy builder
This commit is contained in:
@@ -110,14 +110,15 @@ def option_chain() -> list[dict[str, Any]]:
|
||||
|
||||
|
||||
def strategy_metrics(
|
||||
strategy_name: str,
|
||||
strategy_key: str,
|
||||
scenario_pct: int,
|
||||
*,
|
||||
portfolio: dict[str, Any] | None = None,
|
||||
) -> dict[str, Any]:
|
||||
catalog = strategy_catalog()
|
||||
strategy = next(
|
||||
(item for item in strategy_catalog() if item["name"] == strategy_name),
|
||||
strategy_catalog()[0],
|
||||
(item for item in catalog if item.get("template_slug") == strategy_key or item.get("name") == strategy_key),
|
||||
catalog[0],
|
||||
)
|
||||
portfolio = portfolio or portfolio_snapshot()
|
||||
return strategy_metrics_from_snapshot(strategy, scenario_pct, portfolio)
|
||||
|
||||
Reference in New Issue
Block a user