Quantitative strategy and factor evaluation toolkit for Chinese A-share and Hong Kong (HKEX) markets
Project description
📈 QuantEval
中文说明 / Chinese Guide · 贡献指南 / Contributing
QuantEval is a lightweight, friendly Python toolkit for researching Chinese A-share and Hong Kong (HKEX) strategies, factors, and benchmark comparisons. We've combined a reusable package under src/quanteval, tutorial notebooks, and automated workflows to make your quant journey smoother! 🚀
✨ Highlights
- ⏱️ Backtesting engine with delayed signal execution to keep things realistic (no look-ahead bias here!).
- 🤖 Built-in strategies: Classic strategies like Dual Moving Average, Bollinger Mean Reversion, and consistent Buy-and-Hold... Full set in 👉 src/quanteval/strategies
- 🔀 Strategy Comparison: Multi-strategy correlation analysis, ranking, and equal-weight portfolio construction.
- 📊 Technical factors: From SMA and RSI to MACD, ATR, and more.
- 🔍 Optimization: Grid-search and walk-forward analysis to fine-tune your ideas.
- 🎨 Visualization: Pretty static and interactive plots for your equity curves.
- 💾 Data Caching: Native support for A-share (AkShare) and Hong Kong market (yfinance) stock, ETF, and index data.
🛠️ Installation
📦 From PyPI
The package is available on PyPI. Install the latest released version with:
pip install quanteval
🔨 End users (install from source)
git clone https://github.com/KarhouTam/quanteval.git
cd quanteval
python -m pip install .
🧑💻 Contributors
git clone https://github.com/KarhouTam/quanteval.git
cd quanteval
python -m pip install -e ".[dev]"
🚀 Quick start
Ready to run your first backtest? It's as simple as this:
from quanteval import Backtester, DataLoader, DualMAStrategy
# 1. Grab some data 🏪
loader = DataLoader()
data = loader.load_stock('600519', '20200101', '20231231')
# 2. Pick a strategy 🧠
strategy = DualMAStrategy(fast_window=10, slow_window=60)
# 3. Let's see how it performed! 📊
results = Backtester(strategy=strategy, data=data, transaction_costs=True).run()
print(results.summary())
results.plot()
📖 More examples
Check out these notebooks to level up:
examples/01_quickstart.ipynb: Basic data loading and first backtest 🏃examples/02_parameter_optimization.ipynb: Finding the best parameters 🎯examples/03_strategy_comparison.ipynb: Battle of the strategies ⚔️examples/04_hk_market_support.ipynb: Trading in the Hong Kong market 🇭🇰TUTORIAL_EN.md: Deep dive tutorial 📚
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file quanteval-1.1.0.tar.gz.
File metadata
- Download URL: quanteval-1.1.0.tar.gz
- Upload date:
- Size: 48.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.9.25
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a68a4da0080bb2197511104d339a3130dba77abdc9267adb2b07957d628128ce
|
|
| MD5 |
2140898c6c8afd946e867b71ea6b3275
|
|
| BLAKE2b-256 |
142f3b67673f7ec93abf5c535b0c224b66326649821ab8586ce0dbf0dc8c8f23
|
File details
Details for the file quanteval-1.1.0-py3-none-any.whl.
File metadata
- Download URL: quanteval-1.1.0-py3-none-any.whl
- Upload date:
- Size: 52.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.9.25
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0778eae13f1779ff8f5fb2fe1d821908be11131c403bab44f29ac89ab9ce613c
|
|
| MD5 |
d294000b49ef6980cd41d0ce6039a420
|
|
| BLAKE2b-256 |
a709a115d6effa998d30f74a97ff376b9c5753e99e70b2ef43ed952928f1d1eb
|