The Trade Director

The Trade Director

The Trade Director is a portfolio-level orchestration system that coordinates the execution of multiple strategies simultaneously. It provides centralised risk management through a configurable filter chain.

Standalone vs Trade Director execution

Understanding this distinction is critical for interpreting backtest results.

Standalone mode (no filter)

algo run --strategy kbt --symbols @ES,@NQ,@GC

Each symbol runs as a completely independent backtest:

  • Each symbol gets its own copy of initial capital
  • 3 symbols with $100K capital simulates $300K total
  • No coordination between symbols during execution
  • Results are combined only for reporting

Trade Director mode (with filter or config)

algo run --strategy kbt --symbols @ES,@NQ,@GC --filter max-positions

All strategies share a single coordinated portfolio:

  • All symbols share one pool of initial capital ($100K total)
  • Strategies compete for the same capital
  • Filters coordinate trades across all strategies

Even if a filter approves all trades, results differ from standalone mode because the capital allocation model is fundamentally different:

AspectStandalone ParallelTrade Director
Capital allocationEach symbol gets full initial capitalAll symbols share single initial capital
Position trackingIndependent per symbolCoordinated across portfolio
Filter evaluationNoneSequential, portfolio-aware
Execution modeTruly parallel goroutinesSequential (for portfolio-dependent filters)
Total simulated capitalN symbols x initial capital1 x initial capital

Engaging the Trade Director

The Trade Director is engaged automatically when you use:

  • --filter on the command line
  • --config with a config file containing a filters section

Execution modes

ModeDescription
autoAutomatically selects based on filter requirements (default)
parallelStrategies run independently in separate threads (fastest)
sequentialStrategies run in coordinated order with shared portfolio state

The execution mode is automatically adjusted based on filter compatibility:

  1. No filters or all filters parallel-compatible: Parallel mode (64 workers)
  2. Any filter requires portfolio state: Sequential mode (automatic fallback)
  3. User specifies --execution-mode sequential: Sequential mode (explicit)

Parallel-compatible filters (allow parallel execution):

  • nil – passthrough
  • weekday – day-of-week filtering
  • volatility – volatility threshold filtering
  • position-size (in fixed mode only)

Portfolio-dependent filters (require sequential mode):

  • max-positions – portfolio-wide position limits
  • asset-class – asset class exposure limits
  • category – category exposure limits
  • var – portfolio value at risk limits
  • risk-budget – percentage-of-equity risk budgets
  • atr-position-size – ATR-based volatility position sizing
  • position-size (in risk-parity or equal-weight mode)

Execution mode errors

If you force parallel mode with incompatible filters, an error is raised at startup:

Error: cannot use parallel mode with filters: [max-positions, var]
Hint: remove --execution-mode=parallel or use only parallel-safe filters

If a strategy queries portfolio state while running in parallel mode:

Error: Portfolio query not available in parallel execution mode

Bar coordination

The Trade Director uses a 1-minute time grid in UTC to ensure deterministic execution across strategies with different bar intervals and timezones. For each minute:

  1. Check which strategies have bars completing at this moment
  2. Execute those strategies to generate orders
  3. Process orders through the filter chain
  4. Execute approved orders
  5. Update portfolio state