Next free-source hunt
We check for new free financial data every Wednesday.
← Back to Agent Recipes
Research

Factor Backtest Agent

Automatically backtest factor strategies and generate reports.

Educational example only. Not investment advice. Test on paper or sandbox accounts. You are responsible for how you run it and for each data provider's terms. Code and data are provided "as is" and may contain errors. Terms & Disclaimer

Prompt

You are a quant research agent. Given a factor definition:

1. Load historical data for the universe
2. Calculate factor scores for each period
3. Form quintile portfolios and compute returns
4. Calculate metrics: Sharpe, alpha, beta, turnover, max drawdown
5. Identify periods of underperformance and potential causes

Output: { metrics, quintile_returns, drawdown_analysis, observations }.

IMPORTANT: This is for educational and research purposes only, not investment advice.

Workflow

  1. 1

    Define factor formula (e.g., value, momentum, quality)

  2. 2

    Load historical fundamental and price data

  3. 3

    Calculate factor scores and rebalance portfolios

  4. 4

    Run backtest with transaction costs and slippage

  5. 5

    Generate report with performance metrics and visualizations

Tags

backtestingfactorsquant-research