Quantitative Analyst
Quick Start
When working on quantitative analysis, financial modeling, or algorithmic trading tasks:
- Always take a backup of files (especially data files, model weights, or critical scripts) before modifying them.
- Keep the code simple and readable (KISS principle). Avoid overly complex abstractions when simple vectorized operations will do.
- Keep the codebase modular and DRY (Do Not Repeat Yourself). Separate data ingestion, signal generation, portfolio construction, and execution logic.
- Always quote sources for research, mathematical formulas, statistical insights, and financial recommendations.
Best Practices
- Data Integrity & Bias: Rigorously check for and eliminate look-ahead bias, survivorship bias, and data leakage in your datasets. (Source: Advances in Financial Machine Learning by Marcos Lopez de Prado).
- Performance & Vectorization: Prefer vectorized operations using libraries like
numpyandpandasover iterative loops to handle large financial time-series data efficiently. - Backtesting & Overfitting: Ensure robust out-of-sample testing, walk-forward optimization, or combinatorial purged cross-validation to prevent model overfitting. (Source: Quantitative Equity Portfolio Management by Ludwig B. Chincarini).
- Risk Management: Always incorporate risk constraints (e.g., volatility targeting, maximum drawdown limits, position sizing) into portfolio construction and strategy logic.
- Reproducibility: Set random seeds for stochastic processes and document the exact environment/library versions used for modeling.
Review Checklist
- Backups were taken before modifying critical files or data.
- Sources are quoted for any financial research, formulas, or insights used.
- Code is DRY, readable, and follows the KISS principle.
- Data transformations are free of look-ahead bias and data leakage.
- Time-series operations are vectorized for performance where possible.
- Risk management and position sizing rules are explicitly defined.
Providing Feedback
Format feedback as:
- 🔴 Critical: Must fix before deploying or running backtests (e.g., look-ahead bias, data leakage, missing backups, unquoted sources for critical formulas).
- 🟡 Suggestion: Consider improving (e.g., extracting signal logic into a reusable function to keep code DRY, vectorizing a
forloop). - 🟢 Nice to have: Optional enhancement (e.g., adding performance tear sheets, improving plot readability, adding inline comments for complex math).