Optimizer Lab
Trader and Quant
The Lab is part of the Trader and Quant plans. Trader runs Quick and Standard campaigns; Deep is Quant only. Free can open the preview, which says why it can't run.
The Lab searches your strategy's settings for a better version, then tests whether what it found could be luck. Most campaigns end in a no. The report says why, and half of the campaign's credits come back when that happens.
What a campaign searches
A campaign works on one of your own strategies. To use a built-in one, copy it
first. The strategy needs a PARAMS block with settings to search:
- at least one setting with a
sweeplist, and the declared ranges must make at least 50 combinations between them; - at most 8 searched settings. Lock the rest in the setup step.
It also tries rewrites of the strategy's code. These are made by an AI and checked before they run. A rewrite is refused if it changes the strategy's risk settings (those stay the same for the whole campaign), hard-codes a large number or a year, asks for more tunable settings than the limit, or uses code the sandbox doesn't allow. A refused rewrite is listed with its reason and never evaluated.
You pick the market, timeframe, dates, depth and an objective preset: Steady income, Balanced or Aggressive growth. The presets weigh expected profit per trade, stability and drawdown differently, and set a minimum profit factor of 1.3, 1.2 and 1.1, with a drawdown cap of 15% on Steady income and 35% on Aggressive growth.
The report's per-trade figures are after fees and funding.
How a result is checked
Your dates are split once, at the start, into three periods that never overlap and have a gap between them so the strategy's warm-up cannot leak from one into the next:
| Period | Share | Used for |
|---|---|---|
| Search | at least 60% | Trying settings and rewrites. |
| Validation | at least 25% | Scoring the few candidates that survived the search. |
| Final untouched period | at least 15%, and no less than 90 days | One look at the single best candidate, at the end. |
The search period needs at least 1,000 bars. The final period is spent once: if the best candidate fails there, the campaign reports that and does not try the second best, because that would turn the final period into one more thing the search can pick from.
The stages run in order: a baseline run of your strategy as written, the search, the validation gate, a diagnosis of what held the best candidates back, the AI's rewrites for the next round, a triage of what improved, a battery of robustness checks on the best candidate, and the report. A campaign runs at most 2 rounds on Quick, 3 on Standard and 5 on Deep, and stops sooner after two rounds in a row with no improvement.
The gates
- Baseline trades. The campaign first runs your strategy as written. It has to make at least 50 trades over the whole window, at least 20 in the validation period and, on Standard and Deep, at least 20 in the final period. Under any of these the campaign stops before searching and all of its credits are returned, with the counts in the message.
- A candidate's own trades. At least 20, and at least 40% of the baseline's trade count. Otherwise a filter that throws away most trades could look perfect on six of them.
- Many tries raise the bar. The score a candidate needs on validation rises with every combination the search has tested, and also counts the combinations that earlier campaigns on the same strategy tested. Preview and report quote the figure.
- The overfit check. The search period is cut into parts, and the check needs at least 50 combinations that made 3 or more trades in every part. If fewer did, it can't run, and a Standard or Deep campaign keeps nothing. The preview says what it needs for your window.
Depths and what they cost
| Depth | Credits | Search budget | Rounds | Final period |
|---|---|---|---|---|
| Quick | 10 | about 20 minutes | up to 2 | not spent |
| Standard | 20 | about 60 minutes | up to 3 | spent once |
| Deep | 60 | about 180 minutes | up to 5 | spent once |
Credits come out of the same monthly AI credit pool as chat messages. The campaign takes longer than its search budget, because loading the data and timing the baseline come first. The preview shows each depth's own estimate.
A Quick campaign never touches the final period, so the best it can say is candidate found, not validated. Use it to see whether a strategy is worth a Standard campaign.
A plan also caps how many campaigns you can start per month (Trader 8; Quant 20, of which at most 8 Deep) and runs one campaign at a time.
Refusals
Anything the Lab can check without running is refused before it reserves a campaign or any credits:
- Plan or depth. The Lab on Free, or Deep on Trader.
- A campaign is already running. Wait for it or cancel it.
- Monthly limit or credits. The message says what the campaign costs and how many credits are left.
- The window. The message gives the minimum it needs, for example Use a window of at least N days, or says the market can't hold a window that long yet and gives the earliest date. A faster timeframe gives the search more bars.
- Too few or too many settings. No
PARAMSto search, under 50 combinations, or more than 8 searched settings. - Contact details or credentials in the code. These are refused so they never reach a prompt.
- A strategy the Lab can't size. Its
RISKdeclaration is invalid, or can't size a position on this market.
Several reasons are reported together, so one fix doesn't uncover the next.
What the verdict means
| Verdict | Meaning |
|---|---|
| Champion | The best surviving candidate held up on the final untouched period. It is saved as a new strategy; your original is never changed. |
| Candidate found, not validated | Quick only. The search found something, and nothing tested it on the final period. |
| None kept (no champion) | Nothing cleared validation, or the best candidate was dropped by a robustness check, or it did not hold up on the final period. |
| Cancelled | You stopped it. What had finished is in the report. |
| Failed | It stopped before finishing. |
None kept is the usual answer, and it is a result. The headline says where the field stopped: that none of the combinations reached validation, that none made enough trades there, or what the best candidate scored on validation against the bar it had to beat. The report lists every candidate with the reason it was not kept.
Credits back
| Outcome | Credits returned |
|---|---|
| Champion, or a Quick candidate | none |
| Nothing kept | half |
| Failed, or stopped by the baseline's trade counts | all |
| Cancelled | in proportion to the simulations not yet run |
The Lab's results are simulations on historical data, after spread and slippage. Past simulated results don't predict future ones. To test a champion further, run a forward walk on it and then paper trade it.