deepseek-harness-quant README

The project's README from github.com/yuanwang589-dev/deepseek-harness-quant. As one markdown file: README.md.

DeepSeek HARNESS Quant

自然语言驱动的 A 股量化系统。低频。主观决策 + 写死引擎 + 数据裁决。

AI 不预测个股。这是硬约束,不是选项。

驱动层  语言模型        控制 · 挖因子 · 审计 · 牛散蒸馏
执行层  写死引擎        评分 · 回测 · 风控 · 扫描(确定性 Python,可复现)
事实层  数据系统        PIT · T+1 · 覆盖率分年核查(可证伪)

开始

新用户直接走 一键部署。接入 AI API 后,数据源、配置、验证全交给 AI 向导,不必读本页其余内容。

接入 DeepSeek API

接入 API 后,语言模型接管驱动层。控制、挖因子、审计、魔改,全部解锁。不接入,则只有写死引擎,没有 AI。

前提:完整包(zip)已内置 HARNESS 运行时;单文件(exe)不含 HARNESS,AI 控制台不可用。系统需 Node.js 18+(https://nodejs.org),无则 HARNESS 自动跳过、量化系统照常。

最快方式:双击 接入API.cmd,粘贴 Key,自动写入并验证。

# 1. 获取 Key
#    https://platform.deepseek.com/api_keys

# 2. 复制凭据模板,填入 Key(或直接用接入API.cmd)
copy harness\home\.credentials.yaml.example harness\home\.credentials.yaml
#    编辑 .credentials.yaml:
#    DEEPSEEK_API_KEY: sk-<your-key>

# 3. 启动(打印「启动 DeepSeek HARNESS」即集成成功)
python launcher.py
#    http://127.0.0.1:8787/control

接入后,直接对话:

其余数据源(Tushare 等)接入后让 AI 指导完成。核心逻辑:先接 AI 的 API,AI 帮你接剩下的。

架构

模块 职责
data/ 数据获取 + 本地缓存 + Point-in-Time(cache.py 唯一读取接口)
factors/ 因子引擎 + 机会扫描 + 远期池(五池 T+1/5/20/60 验证)
strategy/ 决策链(L0 择时 → L2 Pitch 审批 → T+1 执行)+ 组合构建
risk/ 风控七道(数据审计 / 因子健康 / FRC 排雷 / Beneish / 竞价 / 单因子 / L0 门控)
backtest/ 回测引擎(T+1 开盘 / 一字板过滤 / 成本模型 / 结论分级)
etf/ ETF 映射(策略暴露 → 可交易配置)
deck/ ui_v2/ Web 决策台(9 页,前端零硬编码)
harness/ DeepSeek HARNESS 运行时(AI 控制台 / 牛散桥 / 动态插件)
config/ 策略注册表 / ETF 池 / 阈值,全部配置化 + .example 模板

因子

123+ 因子,全部 A 股本地实证(PIT / T+1 / 分年度)。九步入池,17+ 项证伪留档。

维度 代表 实证
换手率 turn_mid_prox / turnover / turn_std20 turn_mid_prox ICIR 0.87
低波动 lowvol / std20 / downside_vol 防守底仓主力
反转 reversal20 / o2c 日内反转族 limup_ex_5 ICIR 1.24
流动性 amihud 0.43,多空夏普 1.12
彩票/偏度 max_ret20 / skew20 / rmax max_ret20 0.64
振幅/动量 amp20 / open_prem_20 open_prem_20 0.96
基本面低频 f_score / sue / accruals / asset_growth / bp f_score 120日 0.49
短线涨跌停 limit_up_* / consec_limit_down 跌停排雷 0.97
机构行为 lhb_jg_cnt_20 / shebao_chg lhb 0.90
行业层 ind_crowd_60 / ind_rs_20 拥挤 0.30
Alpha101 alpha015 / alpha050 / alpha006 / alpha003 / alpha044 alpha015 0.76

来源:学术复现 · 开源策略库复刻 · 事件驱动实证 · 牛散蒸馏 · AI 自动挖掘 · 机构资金行为。

Skill

12 个技能文件,封装方法论 + 资产 + 踩坑记录,AI 按需加载。

安装与运行

# 源码
pip install -r requirements.txt
python data/demo/build_demo_db.py    # 生成演示数据
python launcher.py                   # deck:8787 + HARNESS:3080

# 单文件
QuantDeck.exe                        # 双击即用,自动开浏览器

# 完整包
DSHQuant-v1.0.9-Release.zip          # 解压即用,含 HARNESS 运行时

下载注意:从 Release 页 Assets 区下载 DSHQuant-v1.0.9-Release.zip(完整包,含 HARNESS 运行时)。 不要下载页面底部的 "Source code (zip)" —— 那是源码包,harness/node_modules 被排除,没有 AI 控制台。 判断:解压后 harness\node_modules 文件夹存在 = 完整包;不存在 = 下错了。

运行要求:Python 3.10+(源码)/ 无(exe)。HARNESS 控制台需 Node.js 18+(可选)。

数据

数据由用户自行获取。系统不分发数据。

许可

MIT。仅供研究学习。不构成投资建议。

文档

资产盘点 · 架构说明 · 一键部署 · 快速开始 · HARNESS 接入 · 数据说明 · 分钟数据接入

更新机制:scripts/update.py(manifest 驱动,用户配置保护,应用前自动备份)。

deepseek-harness-quant (yuanwang589-dev/deepseek-harness-quant)

trading-bot
Searching Database…

What is this?A natural-language-driven, low-frequency quantitative trading decision system for China's A-share market. It combines a subjective Pitch decision chain, a hardcoded factor engine, and strict data-based arbitration, with the AI forbidden from predicting individual stock moves.
Does the AI pick stocks and trade on its own, or just assist?The AI never predicts individual stocks directly — that's a hard constraint. It drives factor mining, auditing, and chats with 'legendary trader' personas, but decisions still flow through an L0 timing to L2 Pitch approval to T+1 execution chain before anything happens.
How do I get it running?New users should use the one-click deployment: grab DSHQuant-v1.0.9-Release.zip from the Release page Assets (not the auto-generated 'Source code (zip)'), then double-click 接入API.cmd and paste your DeepSeek API key — the AI wizard then sets up data sources, config, and verification for you.
Do I need a DeepSeek API key to use this?Without a key you only get the hardcoded engine with no AI features at all. Connecting a DeepSeek API key unlocks control, factor mining, audits, and runtime customization. Running from source needs Python 3.10+; the exe needs nothing extra; the optional HARNESS AI console additionally needs Node.js 18+.
What install pitfall should I watch out for?Do not grab GitHub's auto-generated 'Source code (zip)' — it leaves out the harness/node_modules folder, so the AI console won't work. You need DSHQuant-v1.0.9-Release.zip from the Release Assets, which bundles the full HARNESS runtime.
Does it come with stock market data built in?No, the system ships no market data at all — you source it yourself (e.g. from Tushare); the repo only has fetch scripts plus synthetic demo data. Turnover-rate data is missing before 2019, so pre-2019 turnover-based conclusions are invalid.
What do the 123+ factors cover?Factors span turnover, low volatility, reversal, liquidity (Amihud), skew/lottery effects, momentum, low-frequency fundamentals (F-score, SUE, accruals), limit-up/down behavior, institutional activity, industry crowding, and Alpha101-style factors, each locally back-tested on A-share data with point-in-time and T+1 controls.
What is the legendary-trader ('牛散') feature?It's a set of 7 personas distilled from well-known real Chinese retail traders you can chat with for stock-picking input; any resulting decision automatically feeds into the five-pool forward-validation pipeline rather than being executed directly.
Can I change the system's behavior without recompiling?Yes — a dynamic Cordis plugin system lets the AI hot-patch runtime behavior through the harness module without rebuilding the codebase.
What are the 12 Skill files for?They're preloaded method and asset files the AI pulls in on demand, covering factor mining workflows, 'legendary trader' distillation profiles, and system maintenance know-how.
Size
1.7 MB
Stars
248
Age
2mo
Commits · 90 Days