ScottZt/jin-ce-zhi-suan

【金策智算】➡️不靠情绪买卖、不追小道消息,专注用客观数据辅助决策。 我们仅提供本地化私有行情数据服务与历史回测工具,帮你把主观想法变成可验证的交易规则,用历史数据检验方法有效性,通过指标监控约束随意操作、控制回撤风险,让交易更有纪律、更落地。 本产品为纯量化工具,不荐股、不指导买卖、不预测行情、不承诺收益,所有决策由用户自主判断,只为你提供客观的数据支撑与AI辅助。作者【硅基流码】

📈 金策智算 – 智能投研决策系统

A Python‑based quantitative‑trading platform that structures the whole workflow (strategy generation → risk‑check → execution) around a “Three‑Ministries‑Six‑Departments” model inspired by the Tang‑dynasty bureaucracy. It offers a web dashboard (FastAPI + HTML) for back‑testing, strategy management and, notably, an AI‑driven natural‑language stock‑screening feature that turns Chinese descriptions into executable filter rules.


🎯 What the project does

Feature What you get
Back‑test engine Historical data ingestion, signal execution, performance reports, consistency checks.
Multi‑strategy management Built‑in strategies plus a plug‑in point for user‑defined ones; batch, portfolio and “BLK/TDX” formula import.
Risk‑first workflow A “gate‑keeping” ministry that can veto trades based on stop‑loss, draw‑down, position limits, etc.
AI condition screening Write a Chinese rule like “五日内有涨停,涨停后缩量至一半以下,RSI 处于超卖区间”; the system calls a large‑model API, parses the intent, and creates a structured filter + execution rule automatically.
Configurable data sources AkShare, Tushare, generic REST API, MySQL or PostgreSQL back‑ends.
Web UI FastAPI server (server.py) serves dashboard.html where you select strategies, set parameters, launch a single‑ticket back‑test or launch the full‑scale “strategy evolution” board.
Strategy evolution board Generates, evaluates and iterates strategies (the README calls it Evolution), useful for automated optimisation.

🏗️ Architecture at a glance

  • Three Ministries (decision chain)
    1. 太子院 (Crown Prince) – data validation & distribution.
    2. 中书省 (Zhongshu Sheng) – strategy signal generation.
    3. 门下省 (Menxia Sheng) – risk review; can veto a trade.
    4. 尚书省 (Shangshu Sheng) – execution & settlement.
  • Six Departments (functional modules)
    • 吏部 – strategy registration & lifecycle.
    • 户部 – cash, cost and NAV accounting.
    • 礼部 – performance reports & ranking.
    • 兵部 – order matching & trade management.
    • 刑部 – violation logging & risk events.
    • 工部 – market data cleaning & indicator calculation.
  • Code layout
    src/
      core/            # ministry orchestration
      ministries/      # department implementations
      strategies/      # built‑in & user strategies
      strategy_intent/ # AI intent parsing
      utils/           # config, data adapters, indicators
    dashboard.html    # UI
    server.py          # FastAPI entry point
    main.py, run_*.py  # CLI helpers for back‑test / live monitoring
    

🚀 Quick‑start (5‑minute guide)

  1. Installpip install -r requirements.txt (Python 3.8+).
  2. Add private config – create config.private.json with your Tushare/LLM API keys (see README example).
  3. Run the serverpython server.py (the script will auto‑install missing deps if needed).
  4. Open the dashboard (usually http://127.0.0.1:8000).
  5. Pick a strategy, fill stock code, date range and initial cash, then click 单票回测 to see the first result.
  6. For batch runs, BLK/TDX imports or strategy evolution, use the 操作工作台 links in the UI.

🤖 AI‑Condition‑Screening workflow

  1. Type a natural‑language stock‑selection idea in Chinese.
  2. The platform calls the configured LLM (llm_api_key in the private config).
  3. The model returns a JSON‑like structure that separates filter conditions from trade‑execution rules.
  4. The filter runs on the chosen data source to produce a candidate universe; the back‑test engine then simulates trades using the execution rules.

📜 License & commercial terms

  • Free for personal, academic, or local‑use (non‑commercial) – you can study the code, run back‑tests, and modify it.
  • Commercial use requires a written license from the author (email: zthx410@163.com). This includes SaaS offerings, selling the software or any profit‑making deployment.
  • The repository includes a full disclaimer stating the tool is not investment advice and that users bear all trading risk.

🙋‍♀️ Contributing

  • Fork → branch → PR.
  • Keep the core scripts runnable.
  • Document test steps in the PR description.

📌 Bottom line

金策智算 is a fairly complete, open‑source quantitative‑research platform that blends traditional back‑testing with a natural‑language‑to‑strategy pipeline powered by large language models. It is suitable for Python developers or quant hobbyists who want a ready‑made framework to experiment with strategy ideas, risk controls, and AI‑assisted stock‑screening, while still being able to dive into the underlying code.

Related

  • Project
  • Project
  • Project
  • Project
  • Project