You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
3 weeks ago | |
|---|---|---|
| common | 3 weeks ago | |
| cta_1d | 3 weeks ago | |
| stock_15m | 3 weeks ago | |
| .env.template | 3 weeks ago | |
| .gitignore | 3 weeks ago | |
| README.md | 3 weeks ago | |
| requirements.txt | 3 weeks ago | |
README.md
Alpha Lab
Quantitative research experiments for qshare library. This repository contains Jupyter notebooks and analysis scripts for exploring trading strategies and machine learning models.
Philosophy
- Notebook-centric: Experiments are interactive notebooks, not rigid scripts
- Minimal abstraction: Simple functions over complex class hierarchies
- Self-contained: Each task directory is independent
- Ad-hoc friendly: Easy to modify for exploration
Structure
alpha_lab/
├── common/ # Shared utilities (keep minimal!)
│ ├── paths.py # Path management
│ └── plotting.py # Common plotting functions
│
├── cta_1d/ # CTA 1-day return prediction
│ ├── 01_data_check.ipynb
│ ├── 02_label_analysis.ipynb
│ ├── 03_baseline_xgb.ipynb
│ ├── 04_blend_comparison.ipynb
│ └── src/ # Task-specific helpers
│
├── stock_15m/ # Stock 15-minute return prediction
│ ├── 01_data_exploration.ipynb
│ ├── 02_baseline_model.ipynb
│ └── src/
│
└── results/ # Output directory (gitignored)
├── cta_1d/
└── stock_15m/
Setup
# Install dependencies
pip install -r requirements.txt
# Create environment file
cp .env.template .env
# Edit .env with your settings
Usage
Start Jupyter and run notebooks interactively:
jupyter notebook
Each task directory contains numbered notebooks:
01_*.ipynb- Data loading and exploration02_*.ipynb- Analysis and baseline models03_*.ipynb- Advanced experiments04_*.ipynb- Comparisons and ablations
Experiment Tracking
Experiments are tracked manually in results/{task}/README.md:
## 2025-01-15: Baseline XGB
- Notebook: `cta_1d/03_baseline_xgb.ipynb` (cells 1-50)
- Config: eta=0.5, lambda=0.1
- Train IC: 0.042
- Test IC: 0.038
- Notes: Dual normalization, 4 trades/day
Adding a New Task
- Create directory:
mkdir my_task - Add
src/subdirectory for helpers - Create numbered notebooks
- Add entry to
results/my_task/README.md
Best Practices
- Keep it simple: Only add to
common/after 3+ copies - Notebook configs: Define CONFIG dict in first cell for easy modification
- Document results: Update results README after significant runs
- Git discipline: Don't commit large files, results, or credentials