Objective metrics

The objective metric tells HyperOptimizer what "best" means. You can emit many metrics, but the experiment should have one primary value to optimize.

Choose one primary objective

Pick a metric that aligns with the decision you want to make. If two metrics matter, choose one as the objective and use the others as guardrails when reviewing results.

Maximize

Use for metrics where larger is better, such as sharpe, profit_factor, or accuracy.

Minimize

Use for metrics where smaller is better, such as loss, latency_ms, or max_drawdown.

Guardrail

Emit secondary metrics to avoid configurations that look good on one number but fail operationally.

Emit supporting metrics

Supporting metrics make the dashboard useful even when they are not the primary objective.

metrics = {
    "objective": score,
    "sharpe": sharpe,
    "max_drawdown": drawdown,
    "total_trades": total_trades,
}

Trading examples

For trading strategy optimization, objective choice matters. A high-profit configuration with huge drawdown may be worse than a steadier configuration.

  • Name
    sharpe
    Type
    maximize
    Description

    Useful when risk-adjusted returns matter more than raw profit.

  • Name
    max_drawdown
    Type
    minimize
    Description

    Useful as a guardrail for downside risk.

  • Name
    profit_factor
    Type
    maximize
    Description

    Useful for comparing gross profit against gross loss.

  • Name
    total_trades
    Type
    guardrail
    Description

    Helps avoid overfitting on too few trades.

Next, review the Docker execution model.

Was this page helpful?