An open-source Python quant trading system for China A-shares covering data management, stock screening, timing, risk control and backtesting.
waditu/czsc
A Python package implementing Chan Zhongshuo (缠论) technical analysis for stocks, futures and crypto, with a Rust core for fractal, stroke and pivot detection.
- Stars
- 6,568
- Forks
- 1,797
- Open issues
- 21
- Last commit
- 23 days ago
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?
czsc is a quantitative analysis toolkit built around Chan Zhongshuo (缠论) technical analysis. It automatically identifies fractals (分型), strokes (笔) and pivot zones (中枢) from K-line data, and supports multi-timeframe analysis that combines several periods in one decision.
Since version 1.0 the core algorithms are implemented in Rust and exposed to Python through PyO3 as the czsc._native extension. The package includes more than 220 signal functions, a signal-event-trade framework where events combine signals with signals_all, signals_any and signals_not, and a CzscTrader class for multi-level trading decisions.
The library also provides data connectors for TQSdk (futures), Tushare (A-shares) and CCXT (crypto exchanges), a weight-based backtester through the companion wbt package, and HTML chart output built on plotly and lightweight-charts.
Key features
- 01Automatic identification of fractals, strokes and pivot zones from K-line data.
- 02Rust core exposed to Python via PyO3, with over 220 signal functions.
- 03Signal, event and position framework with logical combination operators.
- 04Multi-timeframe analysis and trading decisions through CzscTrader.
- 05Connectors for TQSdk, Tushare and CCXT data sources.
- 06Self-contained HTML charts built with plotly and lightweight-charts.
Use cases
- Researching chan-theory based timing strategies on A-shares, futures or crypto.
- Backtesting position-weight strategies with the companion wbt engine.
- Visually checking structure and signal triggers on multi-period K-line charts.
Quick start
- 1
Install the prebuilt package from PyPI (requires Python 3.10+)
pip install czsc -U - 2
Import czsc and run the core chan-theory analysis example from the README
Things to know
- License is unclear (metadata reports NOASSERTION), so check the license before commercial use.
- Documentation and examples are mainly in Chinese and link to Feishu pages.
- Version 1.0 is not compatible with 0.9.X, so older code needs migration.
- Building from source requires a Rust toolchain and maturin.
Topics
FAQ
- What is czsc?
- A Python package implementing Chan Zhongshuo (缠论) technical analysis for stocks, futures and crypto, with a Rust core for fractal, stroke and pivot detection. czsc is a quantitative analysis toolkit built around Chan Zhongshuo (缠论) technical analysis. It automatically identifies fractals (分型), strokes (笔) and pivot zones (中枢) from K-line data, and supports multi-timeframe analysis that combines several periods in one decision.
- Is czsc free to use? What license does it have?
- czsc is open source under the Other license. Check the license terms before using it in commercial products.
- Is czsc still maintained?
- Actively maintained. The last commit to czsc was on Oct 16, 2026.
- What can I use czsc for?
- Researching chan-theory based timing strategies on A-shares, futures or crypto. Backtesting position-weight strategies with the companion wbt engine. Visually checking structure and signal triggers on multi-period K-line charts.
- How do I install czsc?
- Install the prebuilt package from PyPI (requires Python 3.10+): pip install czsc -U Import czsc and run the core chan-theory analysis example from the README
- Where can I get czsc?
- The source code and installation instructions are on GitHub: https://github.com/waditu/czsc
Summary generated by AI from the project's README. GitHub stats refresh daily.
Related projects
Pure-local Python quant trading framework covering stock, futures and options data, backtesting, simulated and live trading, and multi-account management.
An open-source C++/Python quantitative trading framework for strategy research, portfolio construction and backtesting on A-share data.
MCP server giving AI assistants 39 tools for market data, technical analysis, screeners, backtesting and sentiment across crypto, stocks, forex and futures.
A lightweight Python framework for building and running CTP-based futures trading strategies, with live trading and backtesting.
A Python Pandas extension that adds 224 technical analysis indicators and 62 native candlestick patterns to DataFrames, without requiring TA-Lib.