Skip to main content

📈 QuantEval

CI License: MIT Python

中文说明 / 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:

Metadata

Release files for quanteval 1.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for quanteval 1.1.0
File Size Uploaded
quanteval-1.1.0.tar.gz 48.6 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for quanteval 1.1.0
File Interpreter ABI Platform
quanteval-1.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 101.5 kB

Release files / quanteval-1.1.0.tar.gz

Download URL quanteval-1.1.0.tar.gz
Size 48.6 kB
Tags Source
SHA-256 checksum
How to use checksums
a68a4da0080bb2197511104d339a3130dba77abdc9267adb2b07957d628128ce
BLAKE2b-256 checksum
How to use checksums
142f3b67673f7ec93abf5c535b0c224b66326649821ab8586ce0dbf0dc8c8f23
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.9.25

Release files / quanteval-1.1.0-py3-none-any.whl

Download URL quanteval-1.1.0-py3-none-any.whl
Size 52.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
0778eae13f1779ff8f5fb2fe1d821908be11131c403bab44f29ac89ab9ce613c
BLAKE2b-256 checksum
How to use checksums
a709a115d6effa998d30f74a97ff376b9c5753e99e70b2ef43ed952928f1d1eb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.9.25

Release history Release notifications | RSS feed

This release

1.1.0 This release

2 release files

1.0.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page