๐ EasyQuant - Event-driven quantitative trading framework for China A-share market. Backtest strategies, analyze risk metrics, and deploy with eqlib core library.
EasyQuant
Event-driven quantitative backtesting framework for China A-share market.
ไธญๆๆๆกฃ ยท Docs Site ยท Tutorials ยท API Reference
Features
- Event-driven backtesting โ
initializeโrundailyโhandledata(JoinQuant/Zipline compatible) - A-share data โ Daily/minute/tick, fundamentals, money flow, north-bound capital, limit up/down stats
- Risk analysis โ Sharpe, Sortino, max drawdown, alpha/beta, Brinson attribution
- Portfolio risk โ VaR, correlation, concentration, kill switch
- Paper trading โ Run strategies with real-time data + DingTalk/Feishu notifications
- PTrade/QMT adapter โ One-click export to broker platforms
- Web Studio โ Browser-based strategy development (no Python install needed)
Quick Start
pip install easyquant-eqlib
python -c "from eqlib import *; print('eqlib OK')"
from eqlib import *
def initialize(context): g.security = '601390' set_benchmark('000300.XSHG') rundaily(marketopen, time='every_bar')
def market_open(context): hist = attribute_history(g.security, 20, '1d', ['close']) if hist['close'].iloc[-1] > hist['close'].mean() * 1.02: ordervalue(g.security, context.portfolio.availablecash)
result = runstrategy(initialize, startdate='2024-01-01', end_date='2024-12-31', securities=['601390'])
Documentation
| Resource | Description | |----------|-------------| | Docs Site | Full documentation with search and dark theme | | Tutorials | Zero to production, 11 step-by-step guides | | How-to Guides | Task-oriented guides by scenario | | API Reference | All public APIs with parameters and examples | | Examples | 20+ runnable example scripts + Web Studio bonus strategies | | FAQ | Troubleshooting and common questions |
Installation
# From PyPI (recommended)
pip install easyquant-eqlib
From source (for contributors)
git clone https://github.com/AlanFokCo/EasyQuant.git
cd EasyQuant
pip install -e ".[dev]"
python -m pytest tests/
Requirements: Python 3.10+ ยท macOS / Linux / Windows
Contributing
See CONTRIBUTING.md for guidelines.
License
Disclaimer: This project is for educational and research purposes only. It does not constitute investment advice.