feat(EXEC-001): add hedge strategy builder

This commit is contained in:
Bu5hm4nn
2026-03-27 22:33:20 +01:00
parent 554a41a060
commit 4620234967
9 changed files with 429 additions and 37 deletions

View File

@@ -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)