Periscøpe
Docs menu Optimize

Optimize

Run a parameter sweep as a study of backtest trials.

Optimize sweeps strategy parameters across selected values, running each (parameter, value) change as its own backtest. The whole sweep is grouped as a study; each backtest inside it is a trial. Compare trials side by side to see which parameter values produce better metrics.

Concepts

Study

A study is one parameter sweep. It pins a base backtest run (whose strategy and saved config it inherits), a study type (currently only Parameter sweep), a description, and a search space. Studies are launched, monitored, and iterated on from the Optimize tab in the top nav.

Trial

Each trial is one backtest execution inside a study. A study contains exactly one baseline trial that runs the base config unchanged, plus one trial per (parameter, value) entry in the search space. A sweep trial varies one parameter relative to the baseline.

Search space

The search space lists, for each parameter you want to vary, the set of values to try. In the editor's Form view, toggled-on parameters are included in the sweep; disabled parameters are omitted and stay at the base run's value.

Creating a study

Click New Study on the Optimize page (or Optimize on a Backtest run's detail page; see Entry points). The dialog asks for:

  • A base backtest run. The study inherits its strategy version and its saved config; trials override one parameter at a time on top of that config.
  • A study type. Parameter sweep is the only study type today.
  • A description (required).
  • A search space with at least one parameter enabled and at least one value supplied.

Search space editor

Two views are available, toggled by a switch at the top of the editor.

  • Form. One row per parameter. Toggle a row on to include it in the sweep. The value input matches the parameter type: numbers and integers take comma-separated values (with a Range… popover that generates a linear range from start/stop/step, capped at 200 values); booleans take a multi-select across true and false; string enums take a multi-select across the allowed options; plain strings are comma-separated.
  • JSON. Edit the search space as raw JSON. Useful for power-user editing or for values that contain commas. The view switcher is gated on the JSON parsing cleanly.

Below the editor, a trial preview shows the projected trial count and the first batch of generated trial keys (e.g. lookback_bars=20).

Prerequisites and dialog states

A study's base run must have a saved config and a resolvable strategy schema. If either is missing, the dialog surfaces a specific state instead of letting you proceed.

  • Config required for this run. The selected base run has no saved config yet. Configure the run on the Runs page, then return.
  • Couldn't load config. A transient fetch error. Use the inline Retry button.
  • Couldn't resolve strategy schema. The pinned strategy version is missing or its config schema can't be loaded. If this persists, contact support.

If your account has no backtest runs at all, the Optimize page shows an empty state pointing you to Runs to create one first.

Study lifecycle

A study moves through one of six statuses. The label shown in the UI is in parentheses where it differs from the underlying state.

  • Ready (new). Created but not started. Editable.
  • Running. Trials are executing in parallel.
  • Complete. Every trial finished successfully.
  • Partial. Some trials finished, but the study did not complete cleanly.
  • Error. The study itself failed.
  • Stopped. You killed the study.

Actions

  • Start. Available only while the study is Ready. Launches every trial in parallel. The confirmation reminds you of the trial count and notes that the sweep may take several minutes.
  • Edit. Available only while the study is Ready. Change the description or the search space. To edit a study after it has run, Reset it first.
  • Reset. Available when the study is not Running. Wipes completed, errored, and stopped trial results and regenerates the trial set from the current search space. Destructive: cannot be undone.
  • Stop. Available only while the study is Running. Requests a graceful kill of all running trials. The study moves to Stopped after they wind down.

Individual trials can also be killed from their row in the trials table while they are running; the rest of the study continues.

Trials

The trials table lists every trial in the study, baseline first. Each row shows the per-trial metrics once the trial finishes.

  • #. Trial index within the study.
  • Trial. The trial key (for example, lookback_bars=20), or a Baseline badge for the baseline trial.
  • Status. Trial status: pending, running, complete, error, or stopped.
  • Filled/Sub. Orders filled over orders submitted during the trial.
  • P&L. Final portfolio value minus net inserted cash. Coloured by sign.
  • Profit factor. Gross profit divided by the absolute value of gross loss. Shows if the trial had no losing trades, or a blank value marker when there are no closed trades.
  • Trades. Closed trade count.
  • Expectancy. Average per-trade dollar return.
  • Win rate.

Click any row to expand it. The expanded panel shows the strategy overrides (a diff of the parameter values against the baseline), the full metrics summary, and, if the trial failed, the terminal error code and message.

Entry points

  • Optimize tab in the top navigation. Lists every study in your tenant, with status filters across the top. Use the New Study button to start fresh.
  • Optimize button on a Backtest run. A run's detail panel exposes an Optimize action that opens the same Create Study dialog with the current run pre-selected as the base. This affordance appears only on Backtest runs that already have a saved config; Paper and Live runs do not surface it.

Things to know

  • Optimize is backtest-only. There is no equivalent for Paper or Live.
  • The current sweep model is one-axis: each trial varies one parameter relative to the baseline. There is no cross-product or grid search.
  • Internally, the shipped study type is identified as param_sweep; the UI label is Parameter sweep.
  • Trials run in parallel and may take several minutes, depending on the size of the backtest window and the number of trials.
  • Reset wipes completed, errored, and stopped trial results. It cannot be undone.