dsh-a-stock-five-dimension
A DeepSeek Harness (DSH) community agent preset for rigorous A-share five-dimension (technical/valuation/fundamental/capital-flow/news) standardized analysis: persona, skill knowledge base, hard risk gate, deterministic Python scoring core, Tencent-first collectors. Not an investment recommendation.
- Stars
- 1
- Language
- Python
- Created
- Aug 21, 2026
- Updated
- Aug 21, 2026
Introduction
dsh-a-stock-five-dimension · A-Share Five-Dimension Analysis Researcher
A DeepSeek Harness (DSH) community agent preset for rigorous standardized analysis of single A-share stocks across five dimensions: technical (技术面), valuation (估值面), fundamental (基本面), capital flow (资金面), and news/sentiment (消息面). It follows the author's own standard operating procedure (《A股五维分析流程》) and outputs an auditable analysis card with a five-dimension radar score.
Community project — NOT an official DeepSeek preset and not endorsed by DeepSeek. See Relationship with DeepSeek.
Disclaimer: this preset only standardizes information collection and structured presentation. It does not constitute investment advice, recommendations, or return promises.
1. Introduction
- preset id:
dsh-a-stock-five-dimension(the directory name; must match[a-z0-9][a-z0-9-]*) - display name: A股五维分析研究员 (A-Share Five-Dimension Analysis Researcher)
- positioning: a disciplined analyst for one stock — standardized collection → structured scoring → auditable five-dimension report
- scope: single A-share stocks (main board, ChiNext, STAR Market, BSE; ST notes included), free data interfaces first
- boundary: information standardization & presentation only; no buy/sell recommendations, no target prices, no return promises
2. Why this preset
A generic chat model reduces "stock analysis" to a vibe check. This SOP makes it auditable:
- Five dimensions cross-validate each other instead of being isolated islands (技术 = market price behavior, 估值 = is it expensive, 基本面 = is it worth it, 资金 = who is buying/selling, 消息 = what happened / may happen).
- A hard risk gate runs BEFORE any weighted scoring: 立案调查/证监会处罚, 财务造假嫌疑, *ST or delisting period, 债务违约, 非标审计意见, 持续重大经营异常, 面值/市值退市 — one hit ⇒ verdict "回避" (avoid), no composite score. This resolves the linear-weighting paradox where a 10%-weight dimension would veto the total.
- Missing data is renormalized, never zero-scored: missing dimensions are marked 数据不足, weights renormalize over the available dimensions, and the report states data completeness/confidence.
- Discipline is pinned in the persona: one definition per metric (PE defaults to TTM; PB uses latest net assets; main-force funds = super-large + large orders; financials = 归母+扣非), every key value carries a source and date, thresholds are labeled 粗启发值 (untested heuristics), and the model must refuse buy/sell advice requests.
3. How it works
Three parts, all shipped with the repo:
- persona (system prompt) —
agent.cordis.ymlinjects the researcher identity through@deepseek-ai/dsh-persona, embedding the SOP workflow (data prep → hard gate → five dimensions → weighting → report), the forced discipline, and the boundary (no investment advice). - skill (on-demand methodology) —
skills/a-stock-five-dimension-analysis/is registered through@deepseek-ai/dsh-skill-filesystem'scustomSkillDirs; the model loads the relevant chapter (e.g.ch03for valuation,ch05for capital flow) with theskilltool. - data layer (Tencent-first) —
scripts/fetch_*.pyprefer Tencent Finance (行情快照 / 日线 K 线, no token, stdlib-onlytencent.py) and default to the last 60 trading days when no time range is given; AkShare remains primary for 资金面/基本面/消息面 (Tencent exposes no stable A-share fund-flow/fundamentals/news API — probed 2026-08-21; explicitly documented未获取on failure).scripts/score_five_dim.pycomputes the gate verdict, per-dimension scores, renormalized weights, composite, completeness/confidence. JSON in / JSON out withas_of, source stamps, and warning fields. Thescripts/layer is READ-ONLY for the Agent; seeSCRIPTS.md.
The toolset keeps the full standard coding capability; only the identity and knowledge change, so the tool catalog — and thus the request-prefix cache — stays stable.
4. Install
git clone https://github.com/Nzssm1/dsh-a-stock-five-dimension.git \
"$HOME/.dsh/.agent-presets/dsh-a-stock-five-dimension"
Or copy the repository directory into ${DSH_HOME:-$HOME/.dsh}/.agent-presets/ with the exact id name. Then open a new session and pick A股五维分析研究员 in the preset selector.
Requirements: DeepSeek Harness 0.1.0-rc.6+. The preset (persona + skill + tencent.py + deterministic core) needs Python 3.9+ only — no pip packages. The optional akshare (pip install akshare) is needed only for the collector fallback chains (资金面/基本面/消息面).
5. Usage
- Ask:
分析 600519→ full five-dimension report (technical / valuation / fundamental / capital flow / news sentiment, composite score, radar, gate result, bull/bear logic, risk notes). - Ask about
*STor investigated/delisting-risk tickers → verdict 回避 with the hit gate items listed, instead of a weighted score. - Load a chapter:
skill a-stock-five-dimension-analysis ch03(valuation) etc. - The model refuses "直接推荐买入/卖出" and outputs standardized analysis + risk reminder + disclaimer instead.
6. Scripts
Deterministic core (score_five_dim.py) and collectors (tencent.py + fetch_daily.py, fetch_valuation.py, fetch_fundamentals.py, fetch_capital_flow.py, fetch_news.py) — JSON in/out, Tencent-first priority, default last 60 trading days, ak.__version__ printed, interface existence checked, cache-by-trading-day, warnings instead of silent cleaning, explicit "未获取" on failure. Full contract in SCRIPTS.md.
# evidence JSON → gate verdict + scores + composite + completeness
echo '{"symbol":"600519","name":"贵州茅台","as_of":"2026-08-20","gate":{...},"dimensions":{...}}' \
| python3 scripts/score_five_dim.py
python3 scripts/fetch_daily.py --code 600519 # last 60 trading days, Tencent first
python3 scripts/fetch_valuation.py --code 600519 --out ./cache/600519-valuation.json
7. Tests
python3 -m pytest tests -m "not network" # deterministic core + contract tests (offline, no akshare required)
python3 -m pytest tests -m network # optional live smoke tests (require network + akshare)
8. Layout
dsh-a-stock-five-dimension/
├── preset.yml # display metadata (name + description)
├── agent.cordis.yml # Cordis composition: persona + full standard tools + skill
├── skills/a-stock-five-dimension-analysis/
│ ├── SKILL.md # core framework + chapter/topic index
│ ├── chapters/ch00…ch09.md # overview, data sources, technical, valuation,
│ │ # fundamental, capital flow, news sentiment,
│ │ # scoring & output, data quality, disclaimer
│ ├── glossary.md / patterns.md / cheatsheet.md / report-template.md
├── scripts/ # deterministic score core + AkShare-first collectors
├── tests/ # offline unit tests (default) + network smoke markers
├── SCRIPTS.md / README.md / README.zh-CN.md / LICENSE / NOTICE / package.json
└── .github/workflows/test.yml # CI: offline test suite
9. Standards followed
- Metric definitions: PE defaults to PE-TTM (the
stock_zh_a_spot_em"市盈率" field is a dynamic PE and must not be used as TTM); PB uses latest net assets; main-force flows = super-large + large orders (东财口径); financials = 归母 + 扣非; technical lines use 前复权, valuation uses latest close (unadjusted) + latest shares. - Northbound (北向) funds: real-time net buy/sell disclosure stopped 2024-05-13, further weakened 2024-08-19 — only trends & structure references; never fabricate "daily net buy" fine-grained statements.
- All thresholds (score tables, price-limit percentages, conclusion tiers 7.5/6/4.5, completeness bands 85%/60%) are heuristics, unverified against samples; source labels 粗启发值 and states the convention.
10. Relationship with DeepSeek
This is a community project by Nzssm1. It is not an official DeepSeek preset, is not endorsed or sponsored by DeepSeek, and DeepSeek does not review or approve it. The composition is adapted from the standard preset shipped with DeepSeek Harness (MIT). See NOTICE.
11. License
MIT — see LICENSE. GitHub topic: dsh-plugin (used for discovery of DSH community plugins).