BacktestingIntermediate
8 min read

Run an Optimization Job

Set up a parameter optimization job, define constraints, interpret trial results, and avoid the overfitting trap.

Optimization systematically searches over a parameter space to find the configuration that maximises a performance objective. Instead of manually adjusting stop loss levels and indicator periods, you define ranges and let the engine search. The key skill is interpreting results without overfitting.

1

Open the Optimization panel

From the Strategy Builder, click Optimize in the top toolbar. Or go to Backtesting and select the Optimization tab.
2

Select your objective metric

Common choices:
  • Sharpe Ratio (recommended) — balances return and risk
  • Total Return % — maximises raw gains but prone to overfitting
  • Calmar Ratio — optimises for best drawdown-adjusted return
3

Define parameter ranges

For each parameter you want to optimise, enter: minimum value, maximum value, and step size.
  • Stop Loss % min=1, max=5, step=0.5 → 9 candidate values
  • RSI period min=7, max=21, step=2 → 8 candidates
The total number of trials = product of all candidate counts. Keep total trials under 500 for manageable compute cost.
4

Toggle section optimisation

You can independently enable/disable optimisation for Stop Loss, Take Profit, Trailing Stop, and Time Stops. Only optimise sections you actually want to tune — leaving unused sections off reduces compute cost and search space.
5

Set constraints

Constraints are hard requirements that disqualify a trial regardless of its performance. Examples:
  • Max Drawdown must be below 30%
  • Win Rate must be above 40%
  • Trade Count must be above 50
Constraints prevent the optimiser from finding configurations that technically maximise your objective but are practically unusable.
6

Submit the job

Click Run Optimization. Cost: 1 credit per 3 minutes of compute. For a 100-trial search on 1 year of data, expect 3–10 minutes. Progress is shown on the Optimization Trials page.
7

Review trials

On the Trials page, sort by Sharpe Ratio descending. Look at the top 5–10 results. If the best Sharpe is 2.8 and the #10 result is 2.6 across very different parameter values, that's a robust result. If only one narrow parameter set produces a Sharpe above 2.0 and everything else is below 1.0, that's likely overfitting.
8

Check for robustness

A robust optimisation result shows gradual degradation as parameters move away from the optimum — not a sharp cliff. If changing the Stop Loss by 0.5% causes the Sharpe to collapse from 3.0 to 0.5, the result is fragile and likely overfit.
9

Import the winning configuration

From the Trials page, click "Import to Builder" on your chosen trial. Review the imported parameters in the Strategy Builder, run one more backtest on an out-of-sample date range to validate, then save as draft or activate.

Never pick the #1 trial by return %. Instead, find the parameter region where multiple nearby trials produce consistently good Sharpe ratios. A configuration at the centre of a stable region will outperform a spike-optimal configuration in live trading.

Optimizing on the same date range you'll use for final evaluation is data snooping. Reserve the last 20% of your data as an out-of-sample test set. Run optimisation on the first 80%, then validate the winning config on the reserved 20% before activating.

Run an Optimization Job · BitPredict