Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
55 changes: 55 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
name: CI

on:
push:
branches: [main, develop]
pull_request:
branches: [main]

jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.11, 3.12]

steps:
- uses: actions/checkout@v4

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -e ".[dev]"
- name: Lint with ruff
run: |
ruff check src/ tests/
- name: Check formatting with black
run: |
black --check src/ tests/
- name: Run tests
run: |
pytest --cov=src/quant_research_starter --cov-report=xml
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
with:
file: ./coverage.xml
flags: unittests
name: codecov-umbrella

build-docker:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Build Docker image
run: |
docker build -t quant-research-starter:latest .
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
node_modules
node_modules
.vscode
.coverage
54 changes: 52 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,52 @@
# template
A Template Repository for OpenSpringFest (OSF)
# QuantResearchStarter

A modular, open-source quantitative research and backtesting framework designed for clarity and extensibility. Perfect for researchers, students, and developers interested in quantitative finance.

![Python Version](https://img.shields.io/badge/python-3.10%2B-blue)
![License](https://img.shields.io/badge/license-MIT-green)
[![CI](https://github.com/username/QuantResearchStarter/actions/workflows/ci.yml/badge.svg)](https://github.com/username/QuantResearchStarter/actions)

## Features

- **Data Management**: Download real data or generate synthetic data for testing
- **Factor Library**: Implement momentum, value, size, and volatility factors
- **Backtesting Engine**: Vectorized backtester with transaction costs and constraints
- **Risk Metrics**: Comprehensive performance and risk analytics
- **Modular Design**: Easy to extend with new factors and strategies
- **Production Ready**: Type hints, tests, CI/CD, and documentation

## Quick Start

### Installation

```bash
# Clone the repository
git clone https://github.com/username/QuantResearchStarter.git
cd QuantResearchStarter

# Install package in development mode
pip install -e .

# Install development dependencies
pip install -e ".[dev]"

# Optional UI
pip install streamlit plotly
```

### Quick Demo

```bash
make demo
```

Or step-by-step:

```bash
qrs generate-data -o data_sample/sample_prices.csv -s 5 -d 365
qrs compute-factors -d data_sample/sample_prices.csv -f momentum -f value -o output/factors.csv
qrs backtest -d data_sample/sample_prices.csv -s output/factors.csv -o output/backtest_results.json

# Streamlit dashboard (optional)
streamlit run src/quant_research_starter/dashboard/streamlit_app.py
```
Loading