A modular, open-source quantitative research and backtesting framework built for clarity, reproducibility, and extensibility. Ideal for researchers, students, and engineers building and testing systematic strategies.
QuantResearchStarter provides a clean, well-documented starting point for quantitative research and backtesting. Its priorities are:
- Readability: idiomatic Python, type hints, and small modules you can read and change quickly.
- Testability: deterministic vectorized backtests with unit tests and CI.
- Extensibility: plugin-friendly factor & data adapters so you can try new ideas fast.
- Data management — download market data or generate synthetic price series for experiments.
- Factor library — example implementations of momentum, value, size, and volatility factors.
- Vectorized backtesting engine — supports transaction costs, slippage, and portfolio constraints.
- Risk & performance analytics — returns, drawdowns, Sharpe, turnover, and other risk metrics.
- CLI & scripts — small tools to generate data, compute factors, and run backtests from the terminal.
- Production-ready utilities — type hints, tests, continuous integration, and documentation scaffolding.
- Python 3.10+
- pip
# Clone the repository
git clone https://github.com/username/QuantResearchStarter.git
cd QuantResearchStarter
# Install package in development mode
pip install -e .
# Install development dependencies (tests, linters, docs)
pip install -e ".[dev]"
# Optional UI dependencies
pip install streamlit plotlymake demo# generate synthetic sample price series
qrs generate-data -o data_sample/sample_prices.csv -s 5 -d 365
# compute example factors
qrs compute-factors -d data_sample/sample_prices.csv -f momentum -f value -o output/factors.csv
# run a backtest
qrs backtest -d data_sample/sample_prices.csv -s output/factors.csv -o output/backtest_results.json
# optional: start the Streamlit dashboard
streamlit run src/quant_research_starter/dashboard/streamlit_app.pyfrom quant_research_starter.backtest import Backtester
from quant_research_starter.data import load_prices
from quant_research_starter.factors import Momentum
prices = load_prices("data_sample/sample_prices.csv")
factor = Momentum(window=63)
scores = factor.compute(prices)
bt = Backtester(prices, signals=scores, capital=1_000_000)
results = bt.run()
print(results.performance.summary())See the
examples/directory for fully working notebooks and scripts.
Run qrs --help or qrs <command> --help for full usage. Main commands include:
qrs generate-data— create synthetic price series or download data from adaptersqrs compute-factors— calculate and export factor scoresqrs backtest— run the vectorized backtest and export results
QuantResearchStarter/
├─ src/quant_research_starter/
│ ├─ data/ # data loaders & adapters
│ ├─ factors/ # factor implementations
│ ├─ backtest/ # backtester & portfolio logic
│ ├─ analytics/ # performance and risk metrics
│ ├─ cli/ # command line entry points
│ └─ dashboard/ # optional Streamlit dashboard
├─ examples/ # runnable notebooks & example strategies
├─ tests/ # unit + integration tests
└─ docs/ # documentation source
Run unit tests locally with:
pytest -qCI runs linting (ruff), formatting checks (black), and unit tests across supported Python versions. The workflow is defined in .github/workflows/ci.yml.
Contributions are welcome. Please follow these steps:
- Fork the repository
- Create a descriptive branch (feature or fix)
- Add tests for new behavior
- Open a pull request with a clear description and rationale
Before submitting, ensure your tests pass and formatting/linting checks succeed.
Yes — you may use AI tools (ChatGPT, Copilot, etc.) to help write or review code and documentation. Please follow these guidelines:
- Disclose substantial AI assistance in the PR or commit message (e.g., "Generated with ChatGPT; reviewed and adapted by @your-username").
- Review thoroughly all AI-generated code for correctness, security, numerical stability, and licensing concerns.
- Add tests for AI-generated logic when applicable.
- Respect licenses: do not paste or rely on large verbatim copyrighted snippets without appropriate permission or attribution.
This policy encourages fast iteration while maintaining quality and transparency.
This project is available under the MIT License — see the LICENSE file for details.