Strategy research methods

Genetic strategy optimization: search, fitness and validation

Work through a trading-strategy genetic search: define genes, choose fitness, limit trials and freeze the candidate before testing later dates.

As of 2026-10-10

Follow the example

Choose a step to follow the example. Opening a request lets you review it; it does not submit a job or change your account.

Preview the bounded GOOG search: authored process map
Authored task map. It describes what to inspect; it is not an account screenshot or a measured result.
Step 1 of 3

Preview a bounded GOOG genetic search

Start with the exact guarded GOOG 50/200 seed. Build the draft, save only after reviewing validation, then read back your own returned portfolio ID. Review this small search's inputs in Aurora; preview mode returns calendar and cost, not performance.

Seed / exit
SMA50 > SMA200 + empty holding / SMA50 < SMA200 + held position
Capital / shares / dividends
$10,000 / integer / cash
Versions per round / rounds
4 / 2
How versions are compared
Sortino ratio during the comparison period
Full date range / repeated checks
Jan 1, 2016 – Dec 31, 2025 / 4 checks with the same starting date
Build / compare / gap
60% of dates to build / 20% to compare / 14-day gap
What you should see

A valid seed and an explicit preview. Replace the portfolio-ID placeholder with your own read-back ID before the tool call.

Actual seed and first selected mutation: changed entry and exit guards, SMA windows and sell sizing
A concrete rejected-rule lesson from a completed small demonstration; not an offline corpus ranking or a recommended strategy.
Step 2 of 3

Inspect a mutation that broke the seed's holding guards

This completed October 10 example shows why a returned winner needs a rule review. The seed buys only when no GOOG position is held and sells only when a positive position is held. The first selected mutation changed both guards and action sizing; the display names still said 50/200 although the actual indicator windows changed. All four selected books recorded zero closed trades in their outer tests. A completed optimizer job therefore did not establish a working exit process or a measured trade win rate. Inspect the raw fields through get_portfolio before keeping a candidate. Restrict the intended mutation scope, or reject changes that alter the hypothesis or required holding guards.

Entry holding guard
GOOG PositionValue = 0 → GOOG PositionValue < $352,513.37. Entry no longer requires an empty holding
Exit holding guard
GOOG PositionValue > 0 → GOOG PositionValue <= $0. The sell guard no longer admits a positive holding
Entry trend
SMA50 > SMA200 → SMA1353 >= SMA1640. Windows and comparison changed
Exit sizing
100% of the current position → 22.7529% of buying power. Sizing no longer describes the seed exit
What you should see

A concrete rejected-rule lesson from a completed small demonstration; not an offline corpus ranking or a recommended strategy.

Review the research request: authored process map
Authored task map. It describes what to inspect; it is not an account screenshot or a measured result.
Step 3 of 3

Review the exact preview request

Edit this bounded request, supply your own verified seed ID and inspect the planned cost. Keep preview_only true. If you later authorize a launch, record its returned study ID and query it instead of submitting duplicates. Reject selected rules that violate the original holding or exit goal.

What you should see

A deliberate preview and an acceptance check; no automatic paid run or broker operation.

Start with the worked NVDA experiment in Aurora

The beginner example starts with a morning NVDA rule, runs a small genetic search, freezes the selected version and tests later dates. Its charts compare the original strategy, selected winner, NVDA and SPY. The winner made money but held shares across sessions and failed the daytrading goal. Open the guide for the full editable Aurora request and measured decision.

1. Build and save the exact example seed

1. Build and save the exact example seed

Download the public JSON linked below and copy its portfolioConfiguration object, including both strategies, into build_portfolio. This builder validates the draft and returns valid, issues and canonical portfolio output without saving it. Continue only when valid is true and issues are resolved.

Send that same complete object to create_portfolio to save a research draft. Keep the returned portfolio ID, then call get_portfolio with portfolio_id set to that ID. Confirm initialValue 10000, supportsFractionalShares false, dividendPolicy cash, the two strict moving-average comparisons and both PositionValue guards. This saves a draft; it does not activate automated trading.

Use your own returned ID in the preview request. Do not copy an example account or study identifier. If creation is interrupted, inspect fetch_portfolios and get_portfolio before trying again so you do not silently create a duplicate seed.

2. Preview a research GA that actually mutates candidates

Submit this object to run_walk_forward_study after replacing the portfolio_id placeholder. These are the frozen inputs of the small October 10 research demonstration. inner_mode optimize runs the genetic search; backtest_only would instead score the exact seed without mutation. certification false keeps this an exploratory study, not deploy certification.

The default GA mutation scope is not the three-value SMA sweep described later. Inspect the returned winner configurations to see which rule fields changed. A short search demonstrates the process; it does not establish the best possible settings.

The preview returns preview true, folds, plannedUnits and estimatedTokenCost. Check the exact calendar and cost before launch. A preview has no completed performance or studyId.

JSON
{
  "portfolio_id": "<ID returned by your create_portfolio call>",
  "name": "GOOG research GA: population 4, generations 2",
  "global_start_date": "2016-01-01",
  "global_end_date": "2025-12-31",
  "fold_count": 4,
  "walk_forward_mode": "anchored",
  "training_percent": 60,
  "validation_percent": 20,
  "embargo_days": 14,
  "engine_kind": "ga",
  "inner_mode": "optimize",
  "mode": "validation",
  "population_size": 4,
  "num_generations": 2,
  "num_windows": 1,
  "fitness_functions": [
    "sortinoRatio"
  ],
  "leaderboard_size": 4,
  "certification": false,
  "interval": "Day",
  "preview_only": true
}

3. Launch once, then inspect each returned winner

After reviewing the preview, send the same object with preview_only false. Record the returned studyId and rootOptimizerId. This creates a charged research job; it does not place brokerage orders. Do not submit another launch while the existing study is running.

Use get_walk_forward_study_results with the actual returned study_id. If status is RUNNING, wait and query the same study again. COMPLETE should include four foldResults; check the selected individual or candidate key when present, trainingStatistics, validationStatistics, oosStatistics and selectionWarning in each fold. ERROR or an incomplete fold set is a failed or incomplete experiment, not zero performance.

The results tool may materialize winner chat portfolios. Read back each selected portfolio through get_portfolio and compare the raw condition/action fields with the seed. Save all changed thresholds, indicator windows, comparisons and allocations. A familiar display name cannot establish unchanged trading rules.

JSON
{
  "study_id": "<studyId returned by the launch>"
}

Define the strategy before defining its genes

A genetic algorithm evaluates a population of candidate portfolios, selects candidates by fitness, and changes the population across generations. The search explores the rules you allow it to change. It cannot establish that the best historical candidate will work in a future market.

Start with a readable GOOG trend rule: enter only when the 50-day simple moving average exceeds the 200-day average and no GOOG position is held. Write the exit and position-sizing rules separately. A useful first experiment changes the short average while holding the long average, exit, fees and capital fixed. The seed defines the trading hypothesis; the mutation inspection below shows why a completed search still needs rule review.

Turn a vague search into an experiment

These are proposed experimental choices, not measured optimized settings. A discrete three-value comparison can be easier to audit as a sweep. Genetic search is useful when the permitted space and mutation need are larger.

GeneShort SMA window: 20, 50 or 100 trading observationsAll candidates express the same trend hypothesis
Fixed ruleLong SMA window: 200 observationsAvoid changing both sides without recording the larger search
BudgetRecord population, generations and all evaluated candidatesA winner among many trials receives more selection pressure
SelectionChoose on validation under frozen activity/risk floorsTraining fit alone cannot choose the final book
Final testLater dates with the selected exact portfolioDo not mutate after seeing the test

Choose fitness that can reject an inactive portfolio

A high Sharpe score can coexist with too little trading evidence. Record participation, distinct names traded, closed-trade count and maximum drawdown alongside the objective. In NexusTrade, the population fitness path evaluates candidates in training windows; fold winner selection uses validation statistics and the configured constraints. If no candidate clears the floors, the runner can select the best available and attach a warning. That warning means the fold is not certified.

Predeclare how to handle missing statistics, no-signal windows and tied candidates. A candidate with zero closed trades does not have an established trade win rate even if its equity rose while a position remained open.

Keep a trial ledger

Save the seed and every evaluated rule change. Keep failures in the ledger. Count new restarts and rewritten hypotheses as additional trials; a fresh chat does not reset the experiment.

candidate | rules hash | training window | fitness | validation | floor failures | disposition
seed      | frozen hash | calendar         | measured | measured   | recorded       | retain/reject
mutation  | new hash    | same calendar    | measured | measured   | recorded       | retain/reject

A search result still needs a later test

After validation selection, freeze the complete portfolio, its fee contract, interval and data coverage. Run the later test once and report the loss windows as prominently as the positive ones. Changing the rule after that result starts another experiment.

For a fixed portfolio, NexusTrade supports inner_mode backtest_only with engine_kind ga. That label uses the fixed-book orchestration path; it does not run mutation. Deployable GA certification is restricted by the owning launcher. Do not present the fixed-book mode as proof that genetic optimization is certified for live deployment.

Inspect a mutation that broke the seed's holding guards

This completed October 10 example shows why a returned winner needs a rule review. The seed buys only when no GOOG position is held and sells only when a positive position is held. The first selected mutation changed both guards and action sizing; the display names still said 50/200 although the actual indicator windows changed.

All four selected books recorded zero closed trades in their outer tests. A completed optimizer job therefore did not establish a working exit process or a measured trade win rate. Inspect the raw fields through get_portfolio before keeping a candidate. Restrict the intended mutation scope, or reject changes that alter the hypothesis or required holding guards.

Entry holding guardGOOG PositionValue = 0GOOG PositionValue < $352,513.37Entry no longer requires an empty holding
Exit holding guardGOOG PositionValue > 0GOOG PositionValue <= $0The sell guard no longer admits a positive holding
Entry trendSMA50 > SMA200SMA1353 >= SMA1640Windows and comparison changed
Exit sizing100% of the current position22.7529% of buying powerSizing no longer describes the seed exit

A concrete rejected-rule lesson from a completed small demonstration; not an offline corpus ranking or a recommended strategy.

What to inspect before keeping a candidate

Open the per-fold results, confirm the candidate selected in each fold, inspect warnings and compare with an equal-capital baseline over exactly the same dates. If the candidate mainly wins through one late trend, report that concentration. Paper observation after a frozen design tests operational behavior, but it does not remove historical selection bias.

Continue exploring

Aurora · AI research assistant

Try this in Aurora

Edit the request, then open it in Aurora. You choose when to send it.