Strategy Optimizer

The Strategy Optimizer searches variations of the current strategy and keeps the best candidate that satisfies the selected validation rules. It is useful for tuning numeric parameters in strategy features, entry points and rules, and exit points and rules; testing rule simplification; and checking whether an improvement survives an out-of-sample test.

The optimizer does not replace the current strategy while it is searching. It compares candidates with the original backtest and shows the best result in the output panel. Only a candidate whose Search best improves on the original on the full backtest is shown, so the statistics, the balance chart, the Top candidates table, and Accept never fall back to a worse strategy. The single exception is simplification: with Prefer parameter values closer to defaults or rule removal enabled, a candidate that keeps the same Search best but is simpler may also be shown. The candidate becomes part of the current workflow only when you click Accept.

Before You Start

Use the optimizer on a strategy that already has a credible reason to trade and a profitable or otherwise acceptable backtest. Optimizing a losing strategy often finds a version that trades less and loses less, but that does not make the strategy profitable.

Make sure the selected market data covers the period you want to study. Keep a meaningful portion of data out of the optimization when possible. An in-sample improvement is a hypothesis to test, not proof that the strategy will perform in the future.

Toolbar

Start and Stop

Click Start to begin the search. The optimizer backtests candidate strategies within the selected parameter ranges and compares them using Search best. The button changes to Stop while the job is running.

Click Stop when you have enough information or need to change the ranges. The best candidate found so far remains available for review according to the current application state.

The run continues in the background when you leave the Optimizer page. While it is running, a red play marker is shown on the Optimizer tab, so you can follow it from any page; open the page again to see its current progress, calculated count, and results. A run keeps the market, account and forex settings, Data Horizon, parameters, optimizer settings, and validation criteria it was started with, so changing them does not alter a run already in progress.

Progress and Calculated

Progress estimates how much of the current optimization job has been processed. Calculated is the number of candidate backtests performed. These values describe the running job; they are not performance metrics.

Accept, Clear, and Reset

  • Accept saves the shown candidate to the Collection and makes it the current strategy.
  • Clear discards unaccepted results and creates a fresh baseline from the current strategy and market. The candidates and comparison are cleared, the Top candidates table returns to the initial backtest row, the original backtest is recalculated, and the page returns to the Parameters tab. Parameter selections and ranges, optimizer settings, and validation criteria are kept.
  • Reset does the same as Clear and also restores the settings on the Settings tab to their defaults. It rebuilds the parameter rows from the current strategy, selecting every parameter and deriving Min and Max from the default range steps around its current value. Validation criteria are kept.

Neither Clear nor Reset changes the current strategy; both discard unaccepted candidates. The Accept button is enabled only while the selected Top candidates row is an improvement.

Parameters

The Parameters tab uses the same layout as Walk Forward: three neutral category cards, each containing one grouped table of the numeric fields that can be changed:

  • Strategy features contains numeric fields such as Stop Loss and Take Profit.
  • Entry point and rules contains the mandatory entry point and any entry rules.
  • Exit point and rules contains the mandatory exit point and any exit rules.

Each feature or indicator slot has a plain header row inside its category table. Empty categories are omitted. The Parameter, Current, Min, Max, and Step columns stay aligned across all cards; narrow panes scroll each table horizontally instead of squeezing the inputs.

Entry and exit points are always part of the strategy, but their numeric indicator fields can be selected for optimization. The simplification option never removes an entry point or exit point.

Each parameter row contains:

  • Optimize: enable or disable that field for the current run.
  • Current: the value in the current strategy; it updates to the best candidate's value while the optimizer runs.
  • Min: the lower bound of the search range.
  • Max: the upper bound of the search range.
  • Step: the increment between values tested by the optimizer.

The optimizer normalizes reversed bounds into a lower and upper range and respects each field's valid limits. A decimal parameter keeps its permitted precision. A checked row contributes to the search; an unchecked row is left unchanged.

Each card heading carries a selected count and a Toggle button that checks or clears all of its parameters at once: when most of them are checked the button clears them all, otherwise it selects them all. An exact half selects all. Card titles and group header rows are not controls, so clicking them never changes a selection.

Start with a narrow range around a value that already has a reasonable explanation. After reviewing a result, you can center a new, narrower range around the candidate and run a second pass. Widening every range at once greatly increases the search space and makes accidental historical fits more likely.

Settings

The tab groups the objective, the default range steps, the out-of-sample split, and the simplification options. The toolbar's Reset button restores every option on this tab to its default value.

Out of Sample %

Set the percentage of the available data reserved for out-of-sample testing. The remaining data is used in sample. A value of zero disables the split and leaves no separate out-of-sample segment. The panel shows the resulting in-sample and out-of-sample periods in days for the loaded data, so you can judge the split against the strategy's timeframe before starting a run.

An out-of-sample segment gives the optimizer a basic holdout check. It does not make a strategy immune to overfitting, especially when many ranges, objectives, and repeated runs are tried.

Default Range Steps

This value controls the default number of steps used when the optimizer creates an initial range for a parameter. Press Apply to write that range into the Min and Max of every parameter: each range is centered on the parameter's current value, advances by the parameter's own Step, and is clamped to its own limits. Applying replaces Min and Max values edited by hand, but never changes the Step column. Use fewer steps for a quick broad review and more steps for a slower, finer search after you have narrowed the area of interest.

Search Best

This objective determines how candidate results are compared. The comparison shown on the page is always made on the full backtest, because that is what the Statistics tab, the balance chart, and the Top candidates table show. When an out-of-sample split is configured, the search itself fits the in-sample window: the in-sample objective decides which candidates can enter the search, and a candidate reaches the page only when it also improves the objective on the full data. A candidate that is worse in sample but better on the full data is therefore not considered once an in-sample improvement has been accepted. Use out-of-sample data to check that an improvement is not an in-sample artefact, and expect some full-data improvements to be passed over while a split is configured. The available objectives are:

  • Net balance
  • Return to drawdown
  • System quality number
  • Win/loss
  • Sharpe ratio
  • Profit factor
  • Net profit
  • R-squared
  • Max stagnation

Choose an objective that matches the strategy's purpose. Do not select a metric only because it produces the largest historical improvement. Check the other statistics and the balance curve for evidence of a stable result.

Validation Criteria

The optimizer always applies the criteria configured on the Validation tab: a candidate can have a better objective and still be rejected when it violates a selected limit. There is no separate enable switch. The Full data section applies to the complete backtest; the In sample and Out of sample sections apply only when an out-of-sample split is configured.

Top Candidates

The Top candidates table sits below the balance chart, under the Backtest output. It shows rank, net profit, trade count, profit factor, and maximum equity drawdown.

The table lists up to eight improvements, best first, followed by the initial backtest. The initial backtest is the only row until an improvement is found. If eight improvements fill the table, the initial backtest no longer fits and is omitted.

The best row is selected automatically. Selecting another row updates the Statistics tab, Backtest output, balance chart, parameter values, and Accept button. Selection does not change the current strategy; Accept commits the selected candidate. Selecting the initial backtest disables Accept because it is the run's baseline, not an improvement. The selected row is highlighted. Use the Up and Down arrows to move through rows, or Home and End to jump to the first and last row.

While a run is in progress, the table is still filling: the best row remains selected and rows cannot be changed. Stop the run to compare candidates. The table is kept in memory only. Reloading clears it; Clear and Reset leave the current strategy as the only row; Accept makes the accepted candidate the new baseline.

A second Optimizer run cannot be started while one is active. The run keeps the strategy and market it was started with: changing the current strategy from the Editor or the Coll side panel does not cancel or reload the running Optimizer, and the page keeps showing the run with its controls disabled. Once the run finishes, use Clear or Reset to load the current strategy and market and start a new run; the new run replaces the previous candidates.

Simplification

Remove unnecessary or performance-limiting rules tries removing entry and exit rules one at a time. A rule is marked "Removed in the shown candidate" only when its removal passes validation and preserves or improves the selected objective on the full backtest. This option can run without selecting numeric parameters. It never removes entry points, exit points, or strategy features such as Stop Loss and Take Profit.

Prefer parameter values closer to defaults breaks equal-performance ties in favor of values closer to the indicator or feature defaults. It is a tie-breaker, not permission to accept a worse result merely because it is closer to a default.

Simplification is a normalizer-style pass: it can make a strategy easier to understand and may reduce unnecessary degrees of freedom, but every change still needs to be reviewed as a trading decision. Rule removals remain provisional until you accept a candidate; Clear and Reset discard them.

Validation

The Validation tab has three independent sections:

  • Full data applies criteria to the complete backtest period.
  • In sample applies criteria to the data used for optimization when an out-of-sample split is configured.
  • Out of sample applies criteria to the held-out portion of the data.

Click Add criteria in a section to choose a metric, then enter its limit. A criterion can require a minimum value, such as minimum net profit or profit factor, or impose a maximum, such as maximum drawdown, stagnation, or count of trades. Use the remove button on a criterion to delete it, or reset the section to its defaults.

Validation criteria are most useful when they express non-negotiable requirements rather than preferences. For example, a maximum drawdown limit or minimum trade count can prevent the optimizer from selecting a candidate that wins on one objective while becoming impractical elsewhere.

Reading the Results

The Statistics tab compares the original strategy with the selected candidate across the available backtest statistics. The output panel keeps a shorter comparison visible while you work. Pay attention to the relationship between return, drawdown, trade count, stagnation, and the quality metrics instead of reading the selected objective in isolation.

The balance chart overlays the original and optimized balance curves. A higher ending balance is not enough on its own: inspect deep declines, long flat periods, sudden changes in activity, and whether the optimized curve is supported by the out-of-sample section. When the Out of sample percentage is set, a vertical dashed line marks the split, labelled OOS at its bottom-left: the curve to the left of the line is the in-sample part the optimizer fit and the curve to its right is the out-of-sample part.

If no candidate values appear, the search has not streamed an improvement yet. This can happen while the job is running, when no candidate passes validation, or when no candidate improves the original's Search best on the full backtest. A candidate that only improves the in-sample window is not shown.

  1. Run a normal backtest and record the original statistics.
  2. Select only parameters with a plausible relationship to the strategy.
  3. Set realistic Min, Max, and Step values. Avoid changing every parameter at once.
  4. Set Search best to the objective that matches your risk and return priorities.
  5. Reserve out-of-sample data and configure validation criteria when the data set is large enough.
  6. Enable simplification only when you are prepared to review removed rules and default-oriented values.
  7. Start the optimizer and wait for completion, or stop it when you have enough candidates to inspect.
  8. Compare the candidates in the Top candidates table, then read the original and candidate statistics, the balance chart, and all validation sections of the one you picked.
  9. Accept only a candidate that remains plausible outside the optimization objective.
  10. Test the accepted strategy on additional data, markets, or a walk-forward procedure before treating it as ready for live use.

Common Problems

The optimizer finds a worse-looking strategy

Check Search best, validation settings, and the selected parameters. A candidate is only shown when its Search best improves on the original on the full backtest, but it can still be better on that objective while being worse on another statistic. Tighten validation criteria or choose an objective that reflects the actual requirement.

The optimizer changes very little

The ranges may be too narrow, the step may be too large, or validation may reject most candidates. Inspect the progress and calculated count, then adjust one cause at a time.

The result is much better only in sample

Treat this as a likely overfit. Reduce the number of optimized parameters, narrow the search, strengthen validation, and confirm the result on untouched data or with walk-forward testing.

A rule is marked as removed

The simplification option found a candidate without that entry or exit rule that met the configured comparison and validation conditions. Review the resulting strategy and accept it only if the simpler logic still expresses the intended trading idea.