factor_analysis.
Parameters
Pipeline stages defining the strategy. See Pipeline Stage Schema below.
Stock universe:
sp500, russell2000, or nasdaq100Rebalance frequency:
daily, weekly, monthly, or quarterlyPosition sizing method:
equal_weight or inverse_volatilityBacktest start date in
YYYY-MM-DD format.Backtest end date in
YYYY-MM-DD format.Maximum weight per position (0–1). E.g.
0.1 caps each position at 10% of portfolio.Per-position stop loss (0–1). E.g.
0.15 sells a position if it falls 15% from entry.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:| Field | Type | Description |
|---|---|---|
order | integer | Execution order, ascending |
type | string | "screen", "analyze", or "signal" |
skill | string | Any screen type from screen_stocks (e.g. fundamental_screen, momentum_screen) |
config | object | Same config object as screen_stocks |
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.