Event-driven quantitative backtesting framework for China A-share market.
δΈζζζ‘£ Β· Docs Site Β· Tutorials Β· API Reference
- Event-driven backtesting β
initializeβrun_dailyβhandle_data(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)
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')
run_daily(market_open, 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:
order_value(g.security, context.portfolio.available_cash)
result = run_strategy(initialize, start_date='2024-01-01',
end_date='2024-12-31', securities=['601390'])| 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 |
# 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
See CONTRIBUTING.md for guidelines.
Disclaimer: This project is for educational and research purposes only. It does not constitute investment advice.