Strategy Optimization
Fine-tune strategy parameters with genetic algorithms or a systematic sweep.
Strategy Optimization
NexusTrade's optimizer automatically searches for better strategy parameters. It offers two modes: a genetic algorithm that evolves numeric parameters (indicator lookback periods, thresholds, allocation amounts, etc.), and a systematic sweep that grids over meaningful strategy-design choices and is especially powerful for options strategies. The genetic algorithm is covered first; the systematic sweep is described further down.
What Is a Genetic Algorithm?
A genetic algorithm mimics natural selection:
- Population: Create a population of strategy variants with randomized parameters.
- Evaluation: Backtest each variant and measure its fitness (return, Sharpe ratio, etc.).
- Selection: The best-performing variants survive to the next generation.
- Crossover & Mutation: Survivors are combined and slightly mutated to create new variants.
- Repeat: This process repeats for multiple generations, progressively improving performance.
Running an Optimization
- Navigate to your portfolio dashboard.
- Click the "Optimizer" tab.
- Configure the optimization parameters:
- Population size: How many variants per generation (more = slower but more thorough).
- Number of generations: How many rounds of evolution to run.
- Date range: The historical period to optimize against.
- Click "Start Optimization" and monitor progress.
Reading Optimization Results
Each result is an optimization vector — a portfolio variant with its strategies and backtest performance. You can:
- Compare vectors side-by-side
- View the exact parameter changes from your original strategy
- Click "Edit" to replace your portfolio with an optimized variant
Systematic Sweep
The systematic sweep is a second optimizer mode built for structured strategy-design questions, especially options strategies. Instead of randomly mutating numeric parameters, it builds a grid of meaningful variants of your portfolio and evaluates every combination.
Auto mode picks the search strategy for you: it exhaustively evaluates small grids, and switches to a generational search (configurable population size and generations) once the search space gets too large to test exhaustively.
When you point a sweep at a portfolio, NexusTrade inspects your strategies and derives the relevant axes automatically. Depending on what your portfolio actually uses, those can include:
- Strike distance: how far out-of-the-money to sell or buy, swept as %-OTM (e.g. 5%, 10%, 15%). Delta-based selection is also supported for advanced configs.
- Days to expiration (DTE): including LEAP-aware brackets for longer-dated contracts.
- Buying power per position: anchored on your strategy's current allocation rather than a fixed grid, so the sweep won't force over-leverage or over-concentration.
- Total portfolio budget (RebalanceOption): how much of the book's value the strategy may deploy across all names, swept independently of per-name buying power (e.g. 28%, 50%, 90%).
- Allocation percent vs buying power percent: allocation % sizes each trade as a fraction of portfolio value; buying power % sizes as a fraction of available buying power. RebalanceOption books can sweep both axes separately.
- Position count (top-K): how many names to hold or select, anchored on your current limit.
- Entry cooldown, entry/exit filters, universe filters, and rank signals (for example, only enter when price is above its 200-day SMA, or rank candidates by momentum).
- Close-option roll triggers: roll-trigger DTE, when your strategy rolls options.
Selection policy
A sweep ranks variants by a selection policy: a primary metric, optional tie-breakers, and optional constraints. You can rank by Sharpe, Sortino, return, or drawdown, and you can constrain the results, for example requiring a minimum participation rate (the fraction of candidate names that actually traded) so the leaderboard isn't dominated by variants that only fired a couple of times.
Reading sweep results
Sweep results share the same leaderboard as the optimizer. By default the leaderboard is ranked by validation performance, and each variant shows both its training and validation statistics, including participation, so you can spot overfit variants immediately.
Avoiding Overfitting
Both optimizer modes can find strategies with incredible backtested returns that won't hold up in live markets. To avoid overfitting:
- Use a train/validation split: Optimize on 2018-2022, then validate on 2023-2024. If performance drops significantly, the strategy is overfit. Sweeps rank by validation by default for exactly this reason.
- Keep it simple: Don't optimize strategies with too many parameters. Simpler strategies generalize better.
- Look at multiple metrics: Don't just maximize return. Also check Sharpe ratio, max drawdown, and participation.
Token Cost Formula
Optimizations and walk-forward studies draw from the same research token budget as Aurora chat messages and backtests. There is no separate "optimization credit" — it all comes from one pool.
Cost per evaluation:
| Data type |
Cost per evaluation |
| Daily (non-options) |
~0.02 tokens |
| Daily (options) |
~0.04 tokens |
| Intraday (non-options) |
~0.40 tokens |
| Intraday (options) |
~0.60 tokens |
Each evaluation is scaled by an asset factor based on how many assets the strategy uses: sqrt(assets / 500), capped between 0.15 and 1.0. A 50-asset portfolio costs less per evaluation than a 500-asset portfolio.
For a genetic algorithm run: total cost = evaluations per generation × generations × cost per evaluation. A population of 20 across 10 generations = 200 evaluations.
For a sweep: the engine bills by planned evaluations, not the full parameter grid. If the grid is small, every combination is tested. If the grid is large, the engine uses a generational search, and you are only charged for what it actually runs. A sweep over 10 parameter axes does not cost 10× a single-axis sweep.
For a walk-forward study: the optimizer runs once per training window. A 3-year date range split into 6 rolling windows runs the full optimizer 6 times, once per fold.
The minimum cost per optimization run is 2 tokens (so exploratory runs on tiny grids are cheap).
Optimization Limits
Limits depend on your subscription tier (each plan is listed separately so this section stays readable on small screens).
Observer (Free)
- GA + Sweep optimizers: included, priced in research tokens (no daily run limit)
- Population & generations: unlimited (larger runs cost more tokens)
- Compute speed: Regular
Data-Driven Investor
- GA + Sweep optimizers: included, priced in research tokens (no daily run limit)
- Population & generations: unlimited (larger runs cost more tokens)
- Compute speed: Regular
Algorithmic Trader
- GA + Sweep optimizers: included, priced in research tokens (no daily run limit)
- Population & generations: unlimited (larger runs cost more tokens)
- Compute speed: Lightning
Unstoppable Quant
- GA + Sweep optimizers: included, priced in research tokens (no daily run limit)
- Population & generations: unlimited (larger runs cost more tokens)
- Compute speed: Lightning