Skip to content

From a NautilusTrader backtest to a managed parameter search

Connect an existing NautilusTrader backtest to Docker trials, apply strategy inputs, and compare real engine metrics.

Published By HyperOptimizer

A working local backtest is the right starting point. Before searching parameters, fix the instrument, data window, dependencies, fees, and execution assumptions. Run a baseline and record the result. You need to know what changes when the parameters change.

HyperOptimizer runs the outer parameter search. NautilusTrader remains your backtest engine. The same platform also optimizes ML models, simulations, pipelines, and custom containerized programs.

Define a trial boundary

One container invocation should construct the engine, load its data, apply one parameter set, run the backtest, collect metrics, and exit. It should not start another optimization loop or wait for interactive input.

For an EMA strategy, expose the fast and slow periods through command-line flags. Choose ranges that preserve fast < slow, or reject invalid combinations explicitly. Apply the values before constructing the strategy configuration. A flag that never reaches the strategy produces a search that changes inputs without changing behavior.

Keep the data repeatable

Pin NautilusTrader and package the required dependencies in Docker. Preserve chronological timestamps and instrument precision. Fix the dataset for each search and record its date range. A synthetic dataset can verify integration; it cannot establish that a strategy has investment value.

Use a separate holdout window when evaluating configurations selected by the search. Changing the dataset and the parameters together makes it difficult to understand why results differ.

Extract engine metrics rather than inventing a score

After the backtest, read the engine result. PnL reports are organized by currency, so identify the currency and statistic your objective represents. Label a metric such as pnl_usdt with its unit. Record order count alongside the objective to check whether the strategy actually exercised the data.

Fail clearly if the intended report is absent, a value is not finite, or the engine stopped before completing the expected window. A successful exit alone does not make a result usable. Print actual values as hpo.metrics.<name>=<JSON number>.

Validate a small managed experiment

Run the exact image command locally. Publish the image to your workspace registry through the CLI or dashboard publishing instructions. Create a project and define parameters, metric names, maximize/minimize directions, machine size, trial count, concurrency, and timeout.

Validate the configuration, then explicitly launch a small search. Inspect the first successful trial’s parameters, metrics, and logs before increasing its size. Execution uses your current subscription or trial compute allowance.

For the version-specific boundary and common failure cases, read the NautilusTrader integration guide. For other workloads, start with Docker integration.

Compare results with their limitations

The best measured PnL within a search is only the best among the evaluated settings on that dataset. Compare activity, costs, and risk metrics your workload actually computes. Multiple objectives retain their own directions; an implicit combined winner would hide the tradeoff you are trying to understand.

Read the holdout-validation workflow before using selected configurations outside the search window.