A local quant data engine for China A-share daily/minute K-line, ETF and tick data, with incremental sync, adjustment, batch queries, indicators and backtesting.
ling-0729/KHunter
An open-source Python quant trading system for China A-shares covering data management, stock screening, timing, risk control and backtesting.
- Stars
- 712
- Forks
- 188
- Open issues
- 10
- Last commit
- last month
Repolode describes open-source projects and does not give investment advice. Trading and investing can lose money: assess the risk yourself and follow the laws where you live before using this project.
What is it?
KHunter is a quantitative trading system for China's A-share market, aimed at individual investors. It handles the full workflow from pulling market data through running stock-selection strategies and timing signals to backtesting results, with a Flask-based web interface for viewing data, running screens and reviewing outcomes.
The system ships with 12 stock-selection strategies, such as golden-triangle moving-average patterns, limit-up pullbacks and oversold rebounds, plus 8 timing strategies including Bollinger bands, RSI, support levels and turtle-style breakouts. Selected stocks are scored across five dimensions covering technicals, capital flow, fundamentals, sector strength and events, and can be filtered into a watchlist. Automatic filters exclude ST stocks, delisted names, very small caps and stocks that have risen sharply recently.
Data comes mainly from AKShare, with optional Tushare tokens for more stable fundamental and capital-flow data. The project runs on Python 3.10 or newer and stores data in SQLite.
Key features
- 01Stock screening with 12 built-in strategies that can be combined
- 028 timing strategies for buy and sell signals
- 03Five-dimension scoring and ranking of screened stocks
- 04Backtesting with returns, win rate and maximum drawdown reporting
- 05Web dashboard with K-line charts for selected stocks
- 06Automatic data updates that skip when today's data is already present
Use cases
- Screening China A-shares for trend or reversal setups using predefined rules
- Backtesting a trading strategy on local historical data before using it
- Building and tuning custom screening strategies on top of a shared framework
Quick start
- 1
Clone the project repository
git clone https://github.com/ling-0729/KHunter.git - 2
Enter the project directory
cd KHunter - 3
Install dependencies
pip install -r requirements.txt - 4
Start the Web interface
python main.py web
Things to know
- Requires Python 3.10 or newer; older versions will fail to start.
- Full functionality needs a Tushare API token with 6000 points, since free data sources can be unstable.
- Only supports China A-share market data and is intended for learning and research, not investment advice.
- Requires an ADX backfill after upgrading or fresh installs, or buy signals silently stay disabled.
Topics
FAQ
- What is KHunter?
- An open-source Python quant trading system for China A-shares covering data management, stock screening, timing, risk control and backtesting. KHunter is a quantitative trading system for China's A-share market, aimed at individual investors. It handles the full workflow from pulling market data through running stock-selection strategies and timing signals to backtesting results, with a Flask-based web interface for viewing data, running screens and reviewing outcomes.
- Is KHunter free to use? What license does it have?
- KHunter is open source under the Other license. Check the license terms before using it in commercial products.
- Is KHunter still maintained?
- Updated within 6 months. The last commit to KHunter was on Oct 7, 2026.
- What can I use KHunter for?
- Screening China A-shares for trend or reversal setups using predefined rules Backtesting a trading strategy on local historical data before using it Building and tuning custom screening strategies on top of a shared framework
- How do I install KHunter?
- Clone the project repository: git clone https://github.com/ling-0729/KHunter.git Enter the project directory: cd KHunter Install dependencies: pip install -r requirements.txt Start the Web interface: python main.py web
- Where can I get KHunter?
- The source code and installation instructions are on GitHub: https://github.com/ling-0729/KHunter
Summary generated by AI from the project's README. GitHub stats refresh daily.
Related projects
Python quant stock-picking tool for China's A-share market that implements a bowl-rebound strategy, with K-line charts, a Web UI, and DingTalk alerts.
A-share (China stock market) AI research workstation for market analysis, theme tracking, stock research, portfolio inspection and post-market review, local-first desktop app.
Self-hosted A-share quant workbench for building strategies, backtesting, live monitoring and AI-assisted analysis, with open API and MCP access.
A Python package implementing Chan Zhongshuo (缠论) technical analysis for stocks, futures and crypto, with a Rust core for fractal, stroke and pivot detection.
LLM-driven stock analysis system covering A-shares, HK, US, JP, KR and Taiwan stocks, pushing daily decision dashboards to chat apps and email.