factor_analysis.
Parameters
list[object]
required
Pipeline stages defining the strategy. See Pipeline Stage Schema below.
string
default:"sp500"
Stock universe:
sp500, russell2000, or nasdaq100string
default:"monthly"
Rebalance frequency:
daily, weekly, monthly, or quarterlystring
default:"equal_weight"
Position sizing method:
equal_weight or inverse_volatilitystring
default:"2023-01-01"
Backtest start date in
YYYY-MM-DD format.string
default:"2025-12-31"
Backtest end date in
YYYY-MM-DD format.float | null
default:"null"
Maximum weight per position (0–1). E.g.
0.1 caps each position at 10% of portfolio.float | null
default:"null"
Per-position stop loss (0–1). E.g.
0.15 sells a position if it falls 15% from entry.float | null
default:"null"
Portfolio circuit breaker (0–1). E.g.
0.2 moves the portfolio to cash if it drawdowns 20% from peak.Pipeline Stage Schema
Each stage is an object:Multi-stage example
Filter value stocks, then rank survivors by momentum:Example Response
What to do next
Decompose returns
Pass
full_equity_curve to factor_analysis to understand whether returns come from alpha or factor exposure.Compare strategies
Run the same backtest with different screen types, rebalance frequencies, or universes side by side.
Add risk controls
Set
stop_loss, max_position_size, or max_drawdown to see how risk management affects the equity curve.