Depends on: Samy GridOptimizer issue, #111
Design doc: docs/strategy_composable_engine_design.md (§1.7)
Docs: docs/analytics_data_model_specification.md
Two ranking types — do not mix them:
-
Strategy ranking (already exists): build_top_n() ranks different strategies
in the dashboard catalogue. Uses TopNEntry (strategy_id, instrument, metrics).
-
Optimizer ranking (this issue): rank param combos for ONE strategy after
a grid search. Each row has rank + params + metrics.
Scope:
- Define optimizer output JSON schema:
{ strategy_id, instrument, ranked: [{ rank, params, metrics }] }
- Add rank_optimizer_results(reports, config) -> list[OptimizerRankedEntry]
Input: list of (params dict, MetricsReport) from GridOptimizer runs
- Reuse RankingConfig sort order (P&L → drawdown → Sharpe → win rate)
Do NOT call build_top_n() for optimizer results
- Skip invalid / empty runs (non-finite metrics, empty trade log)
- Document schema in docs/analytics_data_model_specification.md
- Agree JSON field names with Samy before Muratich wires #115
Out of scope:
- GridOptimizer implementation (Samy)
- Dashboard UI (#123, Week 6)
- New metrics formulas
- Legacy Python strategy optimizer (Week 6 / P1)
Definition of Done:
- OptimizerRankedEntry (or equivalent) includes rank, params, metrics
- rank_optimizer_results() with unit test: 5 fake grid results → stable top-3
- Schema documented in analytics_data_model_specification.md
- Works with composable strategy_id (e.g. ma_rsi_composable)
Depends on: Samy GridOptimizer issue, #111
Design doc: docs/strategy_composable_engine_design.md (§1.7)
Docs: docs/analytics_data_model_specification.md
Two ranking types — do not mix them:
Strategy ranking (already exists): build_top_n() ranks different strategies
in the dashboard catalogue. Uses TopNEntry (strategy_id, instrument, metrics).
Optimizer ranking (this issue): rank param combos for ONE strategy after
a grid search. Each row has rank + params + metrics.
Scope:
{ strategy_id, instrument, ranked: [{ rank, params, metrics }] }
Input: list of (params dict, MetricsReport) from GridOptimizer runs
Do NOT call build_top_n() for optimizer results
Out of scope:
Definition of Done: