A modular, event-driven quantitative trading system with backtesting support, designed for engineering clarity, extensibility, and real-world trading workflows.
Quant System is a Python-based quantitative trading framework built with an event-driven architecture.
- Clear separation of concerns (data/strategy/execution/portfolio)
- Config-driven runs (YAML)
- Backtesting first, with future extension to paper trading and live trading
- Engineering practices aligned with real-world trading systems
- a personal research & trading system, and a demonstration of engineering capability for quantitative/backend/test-development roles.
- Event-driven backtest engine
- Modular strategy interface
- Commission & slippage modeling
- Self-contained demo configuration (no external data dependency)
- Pytest-based unit testing
- Git workflow aligned with real engineering teams (feature branches, PRs)
python -m venv .venv
-
Windows (PowerShell) . ..venv\Scripts\Activate.ps1
-
macOS / Linux source .venv/bin/activate
pip install -r requirements.txt
The demo configuration does not rely on external APIs (e.g. Tushare). All required data is stored inside the repository.
- python -m src.backtest.engine --config configs/demo.yaml
- local CSV price data
- a simple example strategy
- fixed commission & slippage model
- pytest
All runs are driven by YAML configuration files under configs/.
- Each config file follows the same structure:
run: # runtime behavior (seed, flatten rules, etc.) data: # data source configuration strategy: # strategy name & parameters engine: # capital, commission, slippage, execution settings
File & Description configs/demo.yaml__Self-contained demo config (recommended entry point) configs/backtest.yaml__Backtest preset (WIP) configs/dryrun.yaml__Paper trading preset (WIP) configs/live.yaml Live__trading preset (WIP)
quant_system/ ├── src/ │ ├── backtest/ # backtest engine & core loop │ ├── core/ # event definitions & enums │ ├── execution/ # execution & commission models │ └── data/ # data handlers │ ├── tests/ # pytest unit tests ├── configs/ # YAML run configurations ├── data/ # demo / sample datasets (repo-local) │ ├── README.md ├── requirements.txt └── .gitignore
- Event-driven: MarketEvent → SignalEvent → OrderEvent → FillEvent
- Config-first: behavior changes through YAML, not hardcoded logic
- Backtest correctness over speed (optimization comes later)
- Engineering realism: explicit commissions, slippage, flatten-on-end logic
- The architecture mirrors real quantitative systems while remaining compact and readable.
- Feature development on dedicated branches (e.g. feat/add-demo-config)
- Incremental commits with focused scope
- Merge into main via PR
- Tests required for new logic
Unified CLI entrypoint Strategy registry & dynamic loading Vectorized backtest optimizations Paper trading (dry-run) mode Live trading adapters (broker-specific) Performance analytics & reporting
- This project is for research and educational purposes only.
- It is not investment advice and should not be used for real trading without proper validation, risk control, and compliance review.