Skip to content

AlanFokCo/EasyQuant

Repository files navigation

EasyQuant logo

EasyQuant

Event-driven quantitative backtesting framework for China A-share market.

Tests Docs Python License

δΈ­ζ–‡ζ–‡ζ‘£ Β· Docs Site Β· Tutorials Β· API Reference


Features

  • 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)

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')
    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'])

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

MIT License

Disclaimer: This project is for educational and research purposes only. It does not constitute investment advice.

About

πŸ“Š EasyQuant - Event-driven quantitative trading framework for China A-share market. Backtest strategies, analyze risk metrics, and deploy with eqlib core library.

Topics

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors