Skip to Content

Optimization best practices

Use optimization to answer a focused comparison question. For the product flow, see Run an optimization.

Start with a baseline

Run the strategy once before sweeping parameters. Keep the symbols, frequency, date range, simulation settings, and key metrics so you can tell whether the sweep changed the result meaningfully.

Sweep only what matters

Start with one parameter when you are diagnosing a strategy. Add a second only when you have a reason to test its interaction with the first. Choose ranges from a plausible strategy rationale and use steps large enough to reveal a pattern without creating unnecessary combinations.

Keep every other parameter fixed. Changing strategy logic, data, dates, and simulation settings at the same time makes the comparison difficult to interpret.

Choose metrics for the question

Select a target metric that matches your goal. Total return is useful for growth, but it does not describe risk on its own. Consider pairing it with maximum drawdown percentage, annualized Sharpe ratio, profit factor, expectancy, or percentage of winning trades. Track extra metrics when you need to compare trade-offs in the results table.

Treat the best row as a candidate

Do not choose a strategy because one row ranks first. Compare nearby parameter combinations, trade count, drawdown, and results across more than one symbol or period when possible. A smooth region of good results is generally more useful than one isolated peak.

Check for overfitting

An optimization searches the historical sample you selected. Test a promising combination on a different period or symbol, and compare it with the unoptimized baseline before relying on it. Keep the parameter count and range as small as the research question allows.

Keep data reproducible

For uploaded data, keep the original file and note its source, timezone, units, frequency, and preprocessing. Record the symbols, frequency, date range, simulation settings, and selected metrics for each experiment.

Last updated on