Tang Dynasty bureaucracy meets A-share backtesting
A Chinese quant system that models itself on ancient imperial ministries to separate strategy, risk control, and execution.

What it does
金策智算 (Jin Ce Zhi Suan) is a local-first Python toolkit for backtesting stock strategies on China’s A-share market. You pick or write strategies, run historical simulations through a web dashboard, and get performance reports. It also supports live monitoring, multi-strategy combos, and importing formulas from TDX (a popular Chinese trading terminal).
The interesting bit
The architecture is dressed up as Tang Dynasty “Three Departments and Six Ministries” — 中书省 generates signals, 门下省 vets them with stop-loss and drawdown rules, 尚书省 handles execution, while 吏部/户部/礼部/etc. manage strategy lifecycles, accounting, and reporting. It’s a memorable way to enforce separation of concerns, even if the code underneath is fairly conventional FastAPI + pandas.
Key highlights
- Pluggable data sources: AkShare, Tushare, default API, MySQL, or PostgreSQL
- Web UI via
server.py+dashboard.htmlfor config, backtests, and an “evolution” board for strategy iteration - Risk-control “veto” gate (门下省) with position, stop-loss, and drawdown constraints
- Supports TDX formula conversion and BLK (block) file parsing for batch sector analysis
- Personal non-commercial use is free; commercial deployment requires written authorization from the author
Caveats
- The README’s English is minimal; interface and docs are Chinese-first
- The author is unusually explicit about disclaimers, warning that teahouses, B&Bs, and rental apartments should not use the tool for paid stock-tipping — a specificity that suggests past misuse by third parties
- No benchmark numbers or performance comparisons are provided in the README
Verdict Worth a look if you’re a Mandarin-speaking quant hobbyist or Python developer building A-share research tools. Skip it if you need institutional-grade infrastructure or English-language support.