Skip to content

Objective metrics

Objective metrics tell HyperOptimizer what “best” means. You can emit many metrics; the experiment configuration decides which ones are optimized.

An experiment can define multiple maximize/minimize objectives. Metric names must match the keys you print as hpo.metrics.<key>.

If two metrics matter but you only want to optimize one, keep a single objective and treat 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.

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

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

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

Metric Role Notes
sharpe maximize Useful when risk-adjusted returns matter more than raw profit.
max_drawdown minimize Useful as a guardrail for downside risk.
profit_factor maximize Useful for comparing gross profit against gross loss.
total_trades guardrail Helps avoid overfitting on too few trades.