@weaxs/dsh-stock-analysis 0.1.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +89 -0
- package/cordis.patch.yml +6 -0
- package/dist/index.js +820 -0
- package/package.json +51 -0
- package/schemas/market_review_schema.json +176 -0
- package/schemas/report_schema.json +131 -0
- package/scripts/setup-python.mjs +57 -0
- package/scripts/sync-version.sh +56 -0
- package/scripts/venv-python.mjs +20 -0
- package/skills/bottom-volume/SKILL.md +63 -0
- package/skills/bottom-volume/scripts/gather.py +22 -0
- package/skills/box-oscillation/SKILL.md +72 -0
- package/skills/box-oscillation/scripts/gather.py +22 -0
- package/skills/bull-trend/SKILL.md +60 -0
- package/skills/bull-trend/scripts/gather.py +22 -0
- package/skills/chan-theory/SKILL.md +71 -0
- package/skills/chan-theory/scripts/gather.py +22 -0
- package/skills/dragon-head/SKILL.md +69 -0
- package/skills/dragon-head/scripts/gather.py +22 -0
- package/skills/emotion-cycle/SKILL.md +65 -0
- package/skills/emotion-cycle/scripts/gather.py +22 -0
- package/skills/event-driven/SKILL.md +73 -0
- package/skills/event-driven/scripts/gather.py +22 -0
- package/skills/expectation-repricing/SKILL.md +72 -0
- package/skills/expectation-repricing/scripts/gather.py +22 -0
- package/skills/growth-quality/SKILL.md +74 -0
- package/skills/growth-quality/scripts/gather.py +22 -0
- package/skills/hot-theme/SKILL.md +74 -0
- package/skills/hot-theme/scripts/gather.py +22 -0
- package/skills/ma-crossover/SKILL.md +63 -0
- package/skills/ma-crossover/scripts/gather.py +22 -0
- package/skills/market-review/SKILL.md +70 -0
- package/skills/market-review/scripts/gather.py +23 -0
- package/skills/one-yang-three-yin/SKILL.md +74 -0
- package/skills/one-yang-three-yin/scripts/gather.py +22 -0
- package/skills/shrink-pullback/SKILL.md +59 -0
- package/skills/shrink-pullback/scripts/gather.py +22 -0
- package/skills/stock-analysis/SKILL.md +134 -0
- package/skills/stock-analysis/scripts/gather.py +22 -0
- package/skills/stock-screener/SKILL.md +68 -0
- package/skills/stock-screener/scripts/gather.py +22 -0
- package/skills/strategy-backtest/SKILL.md +129 -0
- package/skills/strategy-backtest/scripts/gather.py +23 -0
- package/skills/volume-breakout/SKILL.md +58 -0
- package/skills/volume-breakout/scripts/gather.py +22 -0
- package/skills/wave-theory/SKILL.md +67 -0
- package/skills/wave-theory/scripts/gather.py +22 -0
- package/skills/wisburg-research/SKILL.md +119 -0
- package/strategies/examples/bottom_volume.yaml +47 -0
- package/strategies/examples/box_oscillation.yaml +41 -0
- package/strategies/examples/bull_trend.yaml +42 -0
- package/strategies/examples/dragon_head.yaml +45 -0
- package/strategies/examples/emotion_cycle.yaml +43 -0
- package/strategies/examples/ma_crossover.yaml +34 -0
- package/strategies/examples/rsi_oversold.yaml +35 -0
- package/strategies/examples/shrink_pullback.yaml +45 -0
- package/strategies/examples/volume_breakout.yaml +42 -0
- package/templates/_macros.j2 +90 -0
- package/templates/market_review/full.md.j2 +103 -0
- package/templates/stock_analysis/brief.md.j2 +28 -0
- package/templates/stock_analysis/full.md.j2 +108 -0
- package/tools/__init__.py +0 -0
- package/tools/alert_rules.py +243 -0
- package/tools/anomaly_detect.py +575 -0
- package/tools/backtest.py +764 -0
- package/tools/capabilities.py +108 -0
- package/tools/diagnostics.py +146 -0
- package/tools/gather.py +157 -0
- package/tools/import_parser.py +279 -0
- package/tools/market_regime.py +252 -0
- package/tools/market_review.py +155 -0
- package/tools/name_resolver.py +136 -0
- package/tools/pattern.py +515 -0
- package/tools/position_context.py +161 -0
- package/tools/report_renderer.py +116 -0
- package/tools/requirements.txt +15 -0
- package/tools/risk_screening.py +323 -0
- package/tools/screener.py +219 -0
- package/tools/search_intel.py +504 -0
- package/tools/stock_data.py +1721 -0
- package/tools/technical.py +642 -0
- package/tools/trading_calendar.py +226 -0
- package/tools/volume_analysis.py +178 -0
- package/tools/watchlist.py +66 -0
- package/tools/watchlist_context.py +185 -0
package/README.md
ADDED
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
# Stock Analysis — DeepSeek Harness (dsh) Plugin
|
|
2
|
+
|
|
3
|
+
A股 / 港股 / 美股 / 日股 / 韩股 / 台股 行情、技术分析、筛选与回测。作为 dsh bundle 安装到 profile 后,对话中可调用 39 个工具,并自动注册 20 个工作流/策略方法论 skill。
|
|
4
|
+
|
|
5
|
+
## 安装
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
dsh plugin --profile <你的profile> add @weaxs/dsh-stock-analysis
|
|
9
|
+
dsh --profile <你的profile>
|
|
10
|
+
```
|
|
11
|
+
|
|
12
|
+
`dsh plugin add` 是 pnpm 的薄封装:安装后 dsh 会读取本包 `package.json` 里的 `dsh.bundle.patch`,把 `cordis.patch.yml` 作为一层叠加进 profile 组合。可用 `dsh --profile <你的profile> --dump-config` 验证 layer 已生效。
|
|
13
|
+
|
|
14
|
+
从源码安装(本仓库根目录):
|
|
15
|
+
|
|
16
|
+
```bash
|
|
17
|
+
npm install && npm run build:dsh
|
|
18
|
+
dsh plugin --profile <你的profile> add ./dsh
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
### Python 运行时
|
|
22
|
+
|
|
23
|
+
工具实际逻辑在 `tools/*.py`,依赖 `akshare`、`pandas`、`numpy`、`requests`。本包的 postinstall(`scripts/setup-python.mjs`)会在包目录下自动建 `.venv` 并装好依赖,前提:本机有 `python3 >= 3.9`。
|
|
24
|
+
|
|
25
|
+
注意:dsh profile 使用 pnpm 且默认不执行第三方包的安装脚本。如 postinstall 被跳过,请在 profile 的 `pnpm-workspace.yaml` 中允许:
|
|
26
|
+
|
|
27
|
+
```yaml
|
|
28
|
+
allowBuilds:
|
|
29
|
+
"@weaxs/dsh-stock-analysis": true
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
如果 venv 最终没建起来,plugin 会回退到系统 `python3`(Windows 为 `python`),此时请自行 `pip install -r tools/requirements.txt`。
|
|
33
|
+
|
|
34
|
+
## 工具列表
|
|
35
|
+
|
|
36
|
+
### 行情数据
|
|
37
|
+
- `get_kline` — K线 OHLCV(A/HK/US/JP/KR/TW)
|
|
38
|
+
- `get_quote` — 实时报价
|
|
39
|
+
- `get_capital_flow` — A股资金流(个股 / 多日 / 板块)
|
|
40
|
+
- `get_news` — 财经新闻
|
|
41
|
+
- `get_financials` — 关键财务指标
|
|
42
|
+
|
|
43
|
+
### 分析
|
|
44
|
+
- `get_technical_analysis` — MA/MACD/RSI/BOLL/KDJ + 综合评分
|
|
45
|
+
- `analyze_pattern` — 12+ 种 K 线形态识别
|
|
46
|
+
- `calculate_ma` — 独立均线计算
|
|
47
|
+
- `get_volume_analysis` — 量价分析
|
|
48
|
+
|
|
49
|
+
### 市场全景
|
|
50
|
+
- `get_market_indices` — 主要指数(CN/HK/US/JP/KR/TW)
|
|
51
|
+
- `get_sector_rankings` — A股板块涨跌幅排行
|
|
52
|
+
- `get_market_stats` — A股大盘统计
|
|
53
|
+
- `get_stock_info` — 股票基本信息
|
|
54
|
+
- `get_chip_distribution` — A股筹码分布
|
|
55
|
+
- `get_fundamental_context` — A股深度基本面
|
|
56
|
+
- `detect_market_regime` — 市场阶段检测
|
|
57
|
+
- `get_market_review` — 大盘日度复盘
|
|
58
|
+
|
|
59
|
+
### 筛选与回测
|
|
60
|
+
- `screen_stocks` — 全市场多因子筛选(AlphaSift L1)
|
|
61
|
+
- `run_backtest` — 策略回测(AlphaEvo)
|
|
62
|
+
- `evaluate_signal` — 信号历史准确率
|
|
63
|
+
- `screen_risk` — 7维度风险筛查
|
|
64
|
+
- `run_watchlist_analysis` — 自选股批量分析
|
|
65
|
+
- `detect_anomaly` — 异动信号扫描
|
|
66
|
+
|
|
67
|
+
### 报告与上下文
|
|
68
|
+
- `render_stock_report` / `render_market_report` — 结构化 JSON → Markdown 报告
|
|
69
|
+
- `build_watchlist_context` — 自选股上下文包
|
|
70
|
+
- `analyze_position_context` — 持仓上下文分析
|
|
71
|
+
- `check_alert_rules` — 无状态告警规则检查
|
|
72
|
+
- `parse_stock_list` — 自选股/文本导入解析
|
|
73
|
+
- `diagnose_data_sources` — 数据源链路诊断
|
|
74
|
+
- `get_market_capabilities` — 市场能力边界
|
|
75
|
+
|
|
76
|
+
### 工具类
|
|
77
|
+
- `resolve_stock_name` — A股名称/拼音 → 代码
|
|
78
|
+
- `check_trading_day` / `get_trading_days` — 交易日历
|
|
79
|
+
|
|
80
|
+
### 情报搜索(需 API Key)
|
|
81
|
+
- `search_stock_news` — Tavily/Brave/SerpAPI 新闻搜索
|
|
82
|
+
- `search_comprehensive_intel` — 6 维度综合情报
|
|
83
|
+
- `get_social_sentiment` — Reddit/X/Polymarket 情绪
|
|
84
|
+
- `get_trending_sentiment` — 社交热门趋势
|
|
85
|
+
- `extract_article` — 文章正文提取
|
|
86
|
+
|
|
87
|
+
## 平行 Host
|
|
88
|
+
|
|
89
|
+
同一份业务逻辑也以 [Pi Agent extension](../pi/index.ts)、[Hermes plugin](../hermes/) 和 [OpenClaw plugin](../openclaw/) 形式分发;选你用的那个生态即可。
|
package/cordis.patch.yml
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
# dsh bundle layer: inserts this package's plugin entry into the profile
|
|
2
|
+
# composition. The entry module is resolved from the profile's node_modules
|
|
3
|
+
# and must export the cordis function-plugin form (name/inject/apply).
|
|
4
|
+
- insert:
|
|
5
|
+
- id: stock-analysis
|
|
6
|
+
name: "@weaxs/dsh-stock-analysis"
|