Two-tool example:backtest a Nasdaq 100 momentum strategy and decompose the returns
This example uses backtest_strategy followed by factor_analysis. It’s the most common two-step workflow: test a strategy, then understand where the returns came from.
Agent interpretation:Alpha is statistically significant:8.2% annualized, t-stat 2.34. There is genuine edge beyond factor exposure.Factor breakdown:
Market (1.12):Slightly higher beta than the market. Amplifies both gains and losses.
Size (-0.35):Large-cap tilt, expected for Nasdaq 100.
Value (-0.29):Anti-value tilt, expected for a momentum strategy that favors expensive growth stocks.
Momentum (0.45):Significant momentum loading, as expected. But the stock selection within the momentum bucket is adding extra value beyond the factor alone.
R-squared: 0.82:82% of variance explained by factors. The remaining 18% is idiosyncratic.
The 1.12 market beta means this strategy will significantly underperform in a bear market. The strong backtest period (2023–2025) was largely bullish:consider stress-testing on 2022 data.