Strategy Lab Overview

Strategy Lab is TradeStaq's AI-powered strategy optimization engine. It takes an existing trading strategy (or a plain-English description) and iteratively improves it through automated mutation, backtesting, and scoring — producing a battle-tested strategy with proven out-of-sample performance.

What Strategy Lab Does

Strategy Lab runs an optimization loop:

┌──────────────────────────────────────────────────────────────┐
│                     STRATEGY LAB                              │
│                                                               │
│  ┌──────────┐   ┌──────────┐   ┌──────────┐   ┌──────────┐  │
│  │ Original │──▶│ AI Mutates│──▶│ Backtest │──▶│ Compare  │  │
│  │ Strategy │   │   Code    │   │ (70/30)  │   │ Scores   │  │
│  └──────────┘   └─────┬────┘   └──────────┘   └────┬─────┘  │
│       ▲               │                             │        │
│       │               │         ┌──────────┐        │        │
│       └───────────────┴─────────│ Keep or  │◀───────┘        │
│          (next experiment)      │  Revert  │                 │
│                                 └──────────┘                 │
└──────────────────────────────────────────────────────────────┘
  1. Start with a strategy (existing code or a description)
  2. AI mutates the strategy code — adjusting indicators, thresholds, risk parameters
  3. Backtest the mutated version on historical data using walk-forward validation
  4. Compare the new version against the current best using the selected scoring profile
  5. Keep or revert — if the mutation improves the score, it becomes the new baseline
  6. Repeat for up to 30 experiments

Each improvement is saved automatically, so the process is crash-safe.

Scoring Profiles

Strategy Lab offers 4 scoring profiles that weight performance metrics differently:

ProfileFocusBest For
BalancedEqual weight across return, drawdown, win rate, and consistencyGeneral-purpose optimization
ConservativePrioritizes low drawdown and steady returnsRisk-averse traders
AggressivePrioritizes total return and profit factorGrowth-focused strategies
ConsistencyPrioritizes win rate and Sortino ratioStrategies with frequent small wins

Choose the profile that matches your risk tolerance and trading style.

Walk-Forward Validation

Strategy Lab does not just optimize on historical data and call it done. It uses walk-forward validation to guard against overfitting:

SplitDataPurpose
Training (70%)Earlier portion of the date rangeAI optimizes against this data
Validation (30%)Later portion of the date rangeTests that improvements generalize

A mutation is only accepted if it improves performance on both the training and validation sets. This ensures the optimized strategy performs well on unseen data, not just the data it was trained on.

Two Modes

ModeInputOutput
Optimize ExistingAn existing TradeStaq strategyImproved version of the same strategy
Create NewA plain-English descriptionA new strategy built and optimized from scratch

What the AI Knows

During each experiment, the AI mutation engine receives:

  • Current strategy code
  • Performance metrics from the latest backtest
  • Indicator snapshots for each trade (what the indicators looked like at entry/exit)
  • Market context (volatility, trend direction)
  • Equity curve samples
  • Trades from the last failed experiment (to avoid repeating mistakes)

This rich context allows the AI to make targeted, informed mutations rather than random changes.

Next Steps