stock-analysis-plugin 0.2.11 → 0.2.13

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.
Files changed (54) hide show
  1. package/README.md +234 -382
  2. package/docs/mcp.md +60 -0
  3. package/hermes/__init__.py +35 -0
  4. package/hermes/plugin.yaml +132 -0
  5. package/hermes/schemas.py +6 -0
  6. package/hermes/tools.py +647 -0
  7. package/mcp_host/__init__.py +1 -0
  8. package/mcp_host/__main__.py +3 -0
  9. package/mcp_host/server.py +222 -0
  10. package/package.json +7 -1
  11. package/pi/index.ts +52 -2906
  12. package/scripts/cli-json.mjs +23 -0
  13. package/scripts/exec-process.mjs +89 -0
  14. package/scripts/setup-python.mjs +37 -4
  15. package/scripts/tool-calls.mjs +493 -0
  16. package/skills/bull-trend/SKILL.md +2 -2
  17. package/skills/bull-trend/references/fat-tails.md +76 -3
  18. package/skills/bull-trend/scripts/tail_analysis.py +92 -3
  19. package/skills/event-driven/SKILL.md +2 -2
  20. package/skills/growth-quality/SKILL.md +1 -1
  21. package/skills/market-review/SKILL.md +1 -0
  22. package/skills/stock-analysis/SKILL.md +12 -7
  23. package/skills/stock-analysis/references/stateless-analysis.md +9 -1
  24. package/skills/stock-screener/SKILL.md +1 -1
  25. package/skills/strategy-backtest/SKILL.md +1 -1
  26. package/tools/_cache.py +13 -0
  27. package/tools/_subproc.py +46 -0
  28. package/tools/alert_rules.py +2 -2
  29. package/tools/backtest.py +3 -3
  30. package/tools/capabilities.py +33 -9
  31. package/tools/cli_budgets.json +1 -0
  32. package/tools/credit_data.py +293 -0
  33. package/tools/diagnostics.py +3 -4
  34. package/tools/gather.py +2 -6
  35. package/tools/import_parser.py +3 -4
  36. package/tools/lixinger.py +119 -27
  37. package/tools/market_regime.py +5 -2
  38. package/tools/market_review.py +5 -6
  39. package/tools/name_resolver.py +45 -33
  40. package/tools/report_renderer.py +3 -3
  41. package/tools/requirements.txt +5 -4
  42. package/tools/risk_screening.py +3 -2
  43. package/tools/screener.py +41 -30
  44. package/tools/search_intel.py +79 -10
  45. package/tools/sec_edgar.py +268 -1
  46. package/tools/sec_holders.py +6 -0
  47. package/tools/signal_tracker.py +5 -5
  48. package/tools/stateless_analysis.py +132 -19
  49. package/tools/stock_data.py +1020 -817
  50. package/tools/tiaa_disclosures.py +4 -0
  51. package/tools/tool_schemas.json +2734 -0
  52. package/tools/trading_calendar.py +65 -30
  53. package/tools/value_data.py +423 -175
  54. package/tools/watchlist.py +43 -5
@@ -0,0 +1,2734 @@
1
+ [
2
+ {
3
+ "name": "calculate_rotation_metrics",
4
+ "description": "行业轮动数值复核:输入真实MC-dropout样本和/或历史成交计数,计算集中度和原始配权;不训练模型、不生成买入信号,零历史不补默认值。",
5
+ "parameters": {
6
+ "type": "object",
7
+ "properties": {
8
+ "prediction_samples": {
9
+ "type": "array",
10
+ "items": {
11
+ "type": "object",
12
+ "properties": {
13
+ "symbol": {
14
+ "type": "string",
15
+ "description": "唯一标的标识"
16
+ },
17
+ "samples": {
18
+ "type": "array",
19
+ "items": {
20
+ "type": "number",
21
+ "description": "同一模型/标的/时间的有限线性输出,不是价格或收益率"
22
+ },
23
+ "description": "2..100000个真实MC-dropout预测;不得用随机数或动量代替"
24
+ }
25
+ },
26
+ "required": [
27
+ "symbol",
28
+ "samples"
29
+ ],
30
+ "additionalProperties": false
31
+ },
32
+ "description": "1..100组,总样本<=100000;和trade_counts至少提供一项"
33
+ },
34
+ "trade_counts": {
35
+ "type": "array",
36
+ "items": {
37
+ "type": "object",
38
+ "properties": {
39
+ "symbol": {
40
+ "type": "string",
41
+ "description": "唯一标的标识;代码别名须先统一"
42
+ },
43
+ "buys": {
44
+ "type": "number",
45
+ "description": "此前已平仓买入周数,非负整数"
46
+ },
47
+ "wins": {
48
+ "type": "number",
49
+ "description": "此前盈利平仓次数,0..buys"
50
+ },
51
+ "streak": {
52
+ "type": "number",
53
+ "description": "此前连续盈利交易次数,0..wins"
54
+ }
55
+ },
56
+ "required": [
57
+ "symbol",
58
+ "buys",
59
+ "wins",
60
+ "streak"
61
+ ],
62
+ "additionalProperties": false
63
+ },
64
+ "description": "1..100条已完成历史成交计数;不得使用决策后的交易"
65
+ }
66
+ },
67
+ "required": [],
68
+ "additionalProperties": false
69
+ }
70
+ },
71
+ {
72
+ "name": "backtest_rotation_allocation",
73
+ "description": "行业轮动配权分项回测:代码自动取行情,或传明确币种/复权OHLCV;相同每周全池买卖下比较等权与历史配权。按市场和报价币种独立资金,支持A/HK/US/JP/KR/TW;不是完整论文深度模型或跨币种共享资金回测。",
74
+ "parameters": {
75
+ "type": "object",
76
+ "properties": {
77
+ "symbols": {
78
+ "type": "array",
79
+ "items": {
80
+ "type": "string",
81
+ "description": "唯一股票/ETF代码,按插件代码格式"
82
+ },
83
+ "description": "1..20只自动取数,与datasets互斥;任一失败整池停止"
84
+ },
85
+ "datasets": {
86
+ "type": "array",
87
+ "items": {
88
+ "type": "object",
89
+ "properties": {
90
+ "symbol": {
91
+ "type": "string",
92
+ "description": "A六位代码/HK如2800.HK/US如XLK/JP如1306.T/KR如069500.KS/TW如0050.TW"
93
+ },
94
+ "currency": {
95
+ "type": "string",
96
+ "description": "已核实报价币种三字母代码,不按上市地猜测"
97
+ },
98
+ "price_basis": {
99
+ "type": "string",
100
+ "enum": [
101
+ "qfq",
102
+ "total_return",
103
+ "split_adjusted"
104
+ ],
105
+ "description": "已核实且一致的复权口径"
106
+ },
107
+ "bars": {
108
+ "type": "array",
109
+ "items": {
110
+ "type": "object",
111
+ "properties": {
112
+ "date": {
113
+ "type": "string",
114
+ "description": "YYYY-MM-DD"
115
+ },
116
+ "open": {
117
+ "type": "number",
118
+ "description": "有限正OHLC价格;volume非负"
119
+ },
120
+ "high": {
121
+ "type": "number",
122
+ "description": "有限正OHLC价格;volume非负"
123
+ },
124
+ "low": {
125
+ "type": "number",
126
+ "description": "有限正OHLC价格;volume非负"
127
+ },
128
+ "close": {
129
+ "type": "number",
130
+ "description": "有限正OHLC价格;volume非负"
131
+ },
132
+ "volume": {
133
+ "type": "number",
134
+ "description": "有限正OHLC价格;volume非负"
135
+ },
136
+ "adjusted": {
137
+ "type": "string",
138
+ "description": "可选逐bar复权标记,存在时必须与price_basis一致"
139
+ },
140
+ "source": {
141
+ "type": "string",
142
+ "description": "可选行情来源标识,用于数据覆盖报告"
143
+ }
144
+ },
145
+ "required": [
146
+ "date",
147
+ "open",
148
+ "high",
149
+ "low",
150
+ "close",
151
+ "volume"
152
+ ],
153
+ "additionalProperties": false
154
+ },
155
+ "description": "递增唯一daily OHLCV,2..20000行,包含评估前预热;总量<=100000"
156
+ }
157
+ },
158
+ "required": [
159
+ "symbol",
160
+ "currency",
161
+ "price_basis",
162
+ "bars"
163
+ ],
164
+ "additionalProperties": false
165
+ },
166
+ "description": "1..20个离线数据集,与symbols互斥;8MiB JSON输入上限"
167
+ },
168
+ "start_date": {
169
+ "type": "string",
170
+ "description": "评估起始YYYY-MM-DD;跨边界周不交易,不能用评估期收益初始化配权"
171
+ },
172
+ "end_date": {
173
+ "type": "string",
174
+ "description": "已收盘截止YYYY-MM-DD;不完整末周不成交"
175
+ },
176
+ "history_start_date": {
177
+ "type": "string",
178
+ "description": "仅代码模式;默认评估前一年,必须早于start_date"
179
+ },
180
+ "warmup_weeks": {
181
+ "type": "number",
182
+ "description": "评估前完整历史交易周1..104整数,默认26;不足停止"
183
+ },
184
+ "capital": {
185
+ "type": "number",
186
+ "description": "每市场/报价币种分组独立初始资金,默认1000000,不是混合池总额"
187
+ },
188
+ "cost_per_side": {
189
+ "type": "number",
190
+ "description": "每边比例成本0..0.1,默认0.001;买入预算含费用"
191
+ }
192
+ },
193
+ "required": [
194
+ "start_date",
195
+ "end_date"
196
+ ],
197
+ "additionalProperties": false
198
+ }
199
+ },
200
+ {
201
+ "name": "analyze_trend_strategy",
202
+ "description": "月度右侧趋势策略:直接传同市场A/HK/US股票代码,自动获取日K,输出月度新入/持有/退出与逆波动预算。as_of默认最近已收盘交易日,持仓可选且不保存,不自动下单;跨样本仍not_validated。",
203
+ "parameters": {
204
+ "type": "object",
205
+ "properties": {
206
+ "symbols": {
207
+ "type": "array",
208
+ "items": {
209
+ "type": "string"
210
+ },
211
+ "description": "同一市场的完整股票池,1..100只;A如600036,HK如0700.HK,US如AAPL"
212
+ },
213
+ "as_of": {
214
+ "type": "string",
215
+ "description": "可选已收盘截止日期YYYY-MM-DD,默认该市场最近已收盘交易日"
216
+ },
217
+ "held_symbols": {
218
+ "type": "array",
219
+ "items": {
220
+ "type": "string"
221
+ },
222
+ "description": "可选,as_of时真实持股代码,必须在股票池中;省略代表初始空仓,不保存账户"
223
+ },
224
+ "pending_exit_symbols": {
225
+ "type": "array",
226
+ "items": {
227
+ "type": "string"
228
+ },
229
+ "description": "可选,真实持股中此前已锁定且未成交的退出代码"
230
+ },
231
+ "slots": {
232
+ "type": "number",
233
+ "description": "可选固定容量K,默认ceil(N/3),不得小于真实持股数量"
234
+ }
235
+ },
236
+ "required": [
237
+ "symbols"
238
+ ],
239
+ "additionalProperties": false
240
+ }
241
+ },
242
+ {
243
+ "name": "get_announcements",
244
+ "description": "查询A股巨潮公告、港股HKEXnews公告与美股SEC EDGAR申报标题、日期、类型和原文链接;按日期范围/类别筛选,默认近90天,top=1..500。A/HK返回PDF链接,美股返回document_url/filing_url并需SEC_USER_AGENT;正文用extract_article提取,truncated提示截断。美股category=all含8-K/6-K/DEF14A,不支持forecast/express/interim/dividend。港股支持all/forecast/annual/interim/quarterly/issuance/dividend,类别按HKEX标题与类型识别,筛选类别时total为已读取页内匹配数(total_basis标明)。",
245
+ "parameters": {
246
+ "type": "object",
247
+ "properties": {
248
+ "symbol": {
249
+ "type": "string",
250
+ "description": "A股代码、港股代码(如00700.HK)、美股ticker或CIK(6位数字CIK须加CIK前缀,如CIK320193)"
251
+ },
252
+ "category": {
253
+ "type": "string",
254
+ "enum": [
255
+ "all",
256
+ "forecast",
257
+ "express",
258
+ "annual",
259
+ "interim",
260
+ "quarterly",
261
+ "reduction",
262
+ "issuance",
263
+ "inquiry",
264
+ "dividend"
265
+ ],
266
+ "description": "公告类别,默认all;美股仅支持all/annual/quarterly/reduction/issuance/inquiry,8-K/6-K/DEF14A经all查询;港股不支持express/reduction/inquiry"
267
+ },
268
+ "start_date": {
269
+ "type": "string",
270
+ "description": "开始日期YYYY-MM-DD,默认结束日期前90天"
271
+ },
272
+ "end_date": {
273
+ "type": "string",
274
+ "description": "结束日期YYYY-MM-DD,默认今天"
275
+ },
276
+ "top": {
277
+ "type": "number",
278
+ "description": "最多条数1..500,默认50"
279
+ }
280
+ },
281
+ "required": [
282
+ "symbol"
283
+ ]
284
+ }
285
+ },
286
+ {
287
+ "name": "get_us_holdings",
288
+ "description": "查询SEC 13F:mode=auto默认有13F申报时查机构,否则按发行人CIK反查持仓机构;manager/issuer可显式指定。发行人通过官方13D/G精确映射CUSIP,扫描最新已发布13F窗口,处理重述/补充修订,返回实际报告期、截止日及映射覆盖。首次约100MB下载,后续缓存;无映射明确报错,不做名称猜测。需SEC_USER_AGENT含真实联系邮箱,不是实时或全部证券持仓。",
289
+ "parameters": {
290
+ "type": "object",
291
+ "properties": {
292
+ "cik": {
293
+ "type": "string",
294
+ "description": "机构或发行人CIK,1..10位数字,如0001067983/0000320193"
295
+ },
296
+ "mode": {
297
+ "type": "string",
298
+ "enum": [
299
+ "auto",
300
+ "manager",
301
+ "issuer"
302
+ ],
303
+ "description": "默认auto;manager查机构组合,issuer反查发行人持仓机构"
304
+ }
305
+ },
306
+ "required": [
307
+ "cik"
308
+ ]
309
+ }
310
+ },
311
+ {
312
+ "name": "get_insider_trades",
313
+ "description": "查询美股发行人近期Form 4/4-A内部人交易(SEC官方XML),保留人员职务、交易代码、买卖方向、数量、价格、脚注和衍生品标志。需SEC_USER_AGENT含真实联系邮箱;days按申报日期筛选,top限制文件数,修订勿重复计数。",
314
+ "parameters": {
315
+ "type": "object",
316
+ "properties": {
317
+ "symbol": {
318
+ "type": "string",
319
+ "description": "美股ticker或发行人CIK"
320
+ },
321
+ "days": {
322
+ "type": "number",
323
+ "description": "申报日期窗口1..365天,默认90"
324
+ },
325
+ "top": {
326
+ "type": "number",
327
+ "description": "最多解析Form 4文件数1..20,默认10"
328
+ }
329
+ },
330
+ "required": [
331
+ "symbol"
332
+ ]
333
+ }
334
+ },
335
+ {
336
+ "name": "get_valuation_history",
337
+ "description": "查询A/HK/US股票历史PE-TTM/PB、当前正值分位和10/25/50/75/90分位Band,返回实际采样区间;亏损估值分位为null。years=1..10,按天缓存。A/HK配置LIXINGER_TOKEN时优先理杏仁非金融公司日历史,失败降级百度,不混接来源。美股需SEC_USER_AGENT,按SEC申报日生效的TTM净利润/股东权益/股本与Yahoo周收盘派生(周采样),share_basis标明股本口径。",
338
+ "parameters": {
339
+ "type": "object",
340
+ "properties": {
341
+ "symbol": {
342
+ "type": "string",
343
+ "description": "A股代码、港股.HK代码或美股代码"
344
+ },
345
+ "years": {
346
+ "type": "number",
347
+ "description": "历史窗口年数1..10,默认5"
348
+ }
349
+ },
350
+ "required": [
351
+ "symbol"
352
+ ]
353
+ }
354
+ },
355
+ {
356
+ "name": "get_index_valuation",
357
+ "description": "查询中国指数估值历史分位与Band;乐咕乐股PE/PB优先,中证官方历史补充滚动PE并保留近期PE1口径。缺PB时可用LIXINGER_TOKEN补充理杏仁mcw历史,来源与算法分别标明,不混接同一指标。",
358
+ "parameters": {
359
+ "type": "object",
360
+ "properties": {
361
+ "symbol": {
362
+ "type": "string",
363
+ "description": "指数代码或名称,如000300、沪深300、000985"
364
+ },
365
+ "years": {
366
+ "type": "number",
367
+ "description": "历史窗口年数1..10,默认5"
368
+ }
369
+ },
370
+ "required": [
371
+ "symbol"
372
+ ]
373
+ }
374
+ },
375
+ {
376
+ "name": "get_cds_index",
377
+ "description": "查询市场级CDS指数作为信用风险偏好背景(非个股CDS或交易信号)。source=cn返回中国货币网CFETS-SHCH高等级/民企/长三角/科创/碳中和在岸CDS指数最新期限曲线(bp)与窗口内各期限变化(percentile为窗口内≤最新值的百分比0..100);source=global取DTCC公开成交,按日汇总当前5Y系列CDX.NA.IG、iTraxx Europe/Crossover利差(bp)与CDX.NA.HY价格(价格下跌=信用走弱),只比较同一到期系列,是成交中位数而非官方收盘。用index/tenor只取需要的指数和期限,cn历史只为匹配到的指数分页拉取。",
378
+ "parameters": {
379
+ "type": "object",
380
+ "properties": {
381
+ "source": {
382
+ "type": "string",
383
+ "enum": [
384
+ "cn",
385
+ "global"
386
+ ],
387
+ "description": "cn=中国在岸CDS指数(默认),global=DTCC公开成交的CDX/iTraxx"
388
+ },
389
+ "days": {
390
+ "type": "number",
391
+ "description": "回看自然日1..90,默认30;global截止到DTCC最新已发布工作日文件"
392
+ },
393
+ "index": {
394
+ "type": "string",
395
+ "description": "指数名,精确匹配优先、否则包含匹配,如民企、科创、高等级、CDX.NA.HY、ITRAXX EUROPE;省略返回全部"
396
+ },
397
+ "tenor": {
398
+ "type": "string",
399
+ "description": "期限,如3M、1Y、5Y;cn按期限过滤,global仅5Y;省略返回全部期限"
400
+ }
401
+ },
402
+ "required": []
403
+ }
404
+ },
405
+ {
406
+ "name": "get_earnings_calendar",
407
+ "description": "查询财报日历:A股report_date必填季度期末,返回预约/修订/实际披露与业绩预告;HK需symbol,优先HKEX已公告业绩审批董事会排期(不是实际披露日);US/JP需symbol并返回yfinance供应商预计日期(provider_only,非官方确认)。HK可按已知财政期末过滤,未知期次与US/JP请求report_date时另列unverified_schedules;KR/TW不可用。",
408
+ "parameters": {
409
+ "type": "object",
410
+ "properties": {
411
+ "report_date": {
412
+ "type": "string",
413
+ "description": "A股必填季度期末YYYY-MM-DD;HK可选已公告财政期末;US/JP不按此匹配财政期,日期另列unverified_schedules"
414
+ },
415
+ "symbol": {
416
+ "type": "string",
417
+ "description": "A股代码可选(省略查全市场);HK/US/JP必须提供对应市场股票代码"
418
+ },
419
+ "top": {
420
+ "type": "number",
421
+ "description": "每类最多返回条数1..500,默认50"
422
+ }
423
+ },
424
+ "required": []
425
+ }
426
+ },
427
+ {
428
+ "name": "get_shareholder_structure",
429
+ "description": "查询A股股东户数、十大流通股东变化及沪深交易所季度北向合计持股;官方总量优先,十大HKSCC名义持股仅兜底且标明口径。HK返回港交所南向记录。缺失不当零,期末不等于已公布。",
430
+ "parameters": {
431
+ "type": "object",
432
+ "properties": {
433
+ "symbol": {
434
+ "type": "string",
435
+ "description": "A股代码或港股.HK代码"
436
+ },
437
+ "report_date": {
438
+ "type": "string",
439
+ "description": "A股报告期YYYY-MM-DD;省略时北向使用最新已公布季度,十大股东使用最新财报期;HK忽略"
440
+ }
441
+ },
442
+ "required": [
443
+ "symbol"
444
+ ]
445
+ }
446
+ },
447
+ {
448
+ "name": "get_etf_details",
449
+ "description": "查询A股ETF净值折溢价、规模、披露持仓及沪深完整PCF申赎篮子;篮子不是实际持仓。include_full_holdings=true另取最近可得半年度/年度披露股票表,含数量/市值/报告期,非实时全资产组合;benchmark用于跟踪误差。",
450
+ "parameters": {
451
+ "type": "object",
452
+ "properties": {
453
+ "include_full_holdings": {
454
+ "type": "boolean",
455
+ "description": "显式请求半年度/年度全部披露股票表,默认false;不是实时全资产组合"
456
+ },
457
+ "symbol": {
458
+ "type": "string",
459
+ "description": "A股ETF代码,如510300"
460
+ },
461
+ "benchmark": {
462
+ "type": "string",
463
+ "description": "可选基准代码:sh000300/399006/000300.SH、中证H30269/93xxxx或^NDX;格式不符报错,不猜测基准"
464
+ },
465
+ "days": {
466
+ "type": "number",
467
+ "description": "净值窗口交易日数10..252,默认60"
468
+ }
469
+ },
470
+ "required": [
471
+ "symbol"
472
+ ]
473
+ }
474
+ },
475
+ {
476
+ "name": "get_dividends",
477
+ "description": "查询A/HK/US/JP/KR/TW分红历史、除息日历、已实施TTM股息与连续年数;history/calendar由symbol决定市场,US/JP/KR/TW使用yfinance。mode=ranking省略symbol,仅A/HK:A查报告期排行,HK查HKEX/LSEG年度股息率排行(report_date须年末);排行均非当前TTM收益率。缺失不按零。",
478
+ "parameters": {
479
+ "type": "object",
480
+ "properties": {
481
+ "market": {
482
+ "type": "string",
483
+ "enum": [
484
+ "A",
485
+ "HK"
486
+ ],
487
+ "description": "仅ranking选择市场,默认A;历史/除息日历由symbol决定"
488
+ },
489
+ "symbol": {
490
+ "type": "string",
491
+ "description": "history/calendar必填A/HK/US/JP/KR/TW股票代码(如600519、00700.HK、AAPL、7203.T、005930.KS、2330.TW);ranking省略"
492
+ },
493
+ "mode": {
494
+ "type": "string",
495
+ "description": "history默认;calendar未来已公布除息事件;ranking按market查询A/HK排行",
496
+ "enum": [
497
+ "history",
498
+ "calendar",
499
+ "ranking"
500
+ ]
501
+ },
502
+ "report_date": {
503
+ "type": "string",
504
+ "description": "ranking报告期YYYY-MM-DD,默认上一年年末;HK仅年度年末日期"
505
+ },
506
+ "years": {
507
+ "type": "number",
508
+ "description": "历史窗口年数1..20,默认10"
509
+ },
510
+ "top": {
511
+ "type": "number",
512
+ "description": "排名条数1..500,默认20"
513
+ }
514
+ },
515
+ "required": []
516
+ }
517
+ },
518
+ {
519
+ "name": "get_kline",
520
+ "description": "获取股票K线数据(OHLCV)。支持A股(如600519)、港股(如00700.HK)、美股(如AAPL)、日股(如7203.T)、韩股(如005930.KS)、台股(如2330.TW)及A股ETF。A股股票/ETF返回前复权价格,每条记录 adjusted=qfq;sh000xxx/sz399xxx 指数返回原始点位,adjusted=none。需要历史价格自行计算或画图时用;只问指标用 get_technical_analysis,只问现价用 get_quote。每条记录附 source、UTC fetched_at、data_as_of 和 adjusted;非A股复权口径可能为total_return/qfq/unknown,未知不能假定已复权。部分来源附 adjustment_factor(复权价格/原始价格);缺失不能猜测换算系数。",
521
+ "parameters": {
522
+ "type": "object",
523
+ "properties": {
524
+ "symbol": {
525
+ "type": "string",
526
+ "description": "股票代码,如 600519(A股)、00700.HK(港股)、AAPL(美股)、7203.T(日股)、005930.KS(韩股)、2330.TW(台股)"
527
+ },
528
+ "period": {
529
+ "type": "string",
530
+ "enum": [
531
+ "daily",
532
+ "weekly",
533
+ "monthly"
534
+ ],
535
+ "description": "K线周期,默认 daily"
536
+ },
537
+ "count": {
538
+ "type": "number",
539
+ "description": "返回数据条数,默认 60"
540
+ }
541
+ },
542
+ "required": [
543
+ "symbol"
544
+ ]
545
+ }
546
+ },
547
+ {
548
+ "name": "get_quote",
549
+ "description": "获取股票实时行情报价(现价、涨跌幅、量比等)。支持A股、港股、美股、日股、韩股、台股;非交易时段返回最近交易日收盘价并以 as_of/stale 标注;ETF 的 premium_discount_rate 为正=溢价、负=折价。返回 source、UTC fetched_at 和提供方 data_as_of(未知为null);as_of_basis区分提供方时间与交易日历推断,采集时间不等于行情时间。场外基金用 get_fund_quote;TIAAxxxxxx 返回投顾组合识别、advisor_org 与无统一净值提示;长钱/海外长钱/稳钱另有有知有行 official_disclosures(partial=true,非实时完整持仓);其他组合搜索可用时为 search_partial,否则 unsupported_provider。",
550
+ "parameters": {
551
+ "type": "object",
552
+ "properties": {
553
+ "symbol": {
554
+ "type": "string",
555
+ "description": "股票代码(A股如600519,美股如AAPL,港股如00700.HK)"
556
+ }
557
+ },
558
+ "required": [
559
+ "symbol"
560
+ ]
561
+ }
562
+ },
563
+ {
564
+ "name": "get_fund_quote",
565
+ "description": "获取场外公募基金净值(6位基金代码,如018147)。nav 是已披露日终净值,非实时价;返回 accumulated_nav(累计净值)、change_pct(日涨跌幅)、nav_date(净值日期)。estimated_nav 为估算净值,可能为 null,不能当作实时价;QDII 净值可能滞后 1-2 交易日。",
566
+ "parameters": {
567
+ "type": "object",
568
+ "properties": {
569
+ "symbol": {
570
+ "type": "string",
571
+ "description": "6位场外公募基金代码,如 018147"
572
+ }
573
+ },
574
+ "required": [
575
+ "symbol"
576
+ ]
577
+ }
578
+ },
579
+ {
580
+ "name": "get_capital_flow",
581
+ "description": "获取A股资金流向(主力/超大单/大单/中单/小单净流入)。detail=个股每日明细,summary=多日汇总+趋势,sector_flow=板块资金流排行。可配合 get_chip_distribution 验证主力行为",
582
+ "parameters": {
583
+ "type": "object",
584
+ "properties": {
585
+ "symbol": {
586
+ "type": "string",
587
+ "description": "A股股票代码(detail/summary模式必填),如 600519"
588
+ },
589
+ "mode": {
590
+ "type": "string",
591
+ "enum": [
592
+ "detail",
593
+ "summary",
594
+ "sector_flow"
595
+ ],
596
+ "description": "模式:detail=每日明细(默认),summary=多日汇总,sector_flow=板块排行"
597
+ }
598
+ }
599
+ }
600
+ },
601
+ {
602
+ "name": "get_news",
603
+ "description": "获取个股最近N天财经新闻快讯(轻量、无需配置)。需要深度全网情报用 search_comprehensive_intel,按主题搜索用 search_stock_news,读文章全文用 extract_article",
604
+ "parameters": {
605
+ "type": "object",
606
+ "properties": {
607
+ "symbol": {
608
+ "type": "string",
609
+ "description": "股票代码(A股如600519,美股如AAPL,港股如00700.HK)"
610
+ },
611
+ "days": {
612
+ "type": "number",
613
+ "description": "获取最近几天的新闻,默认 3"
614
+ }
615
+ },
616
+ "required": [
617
+ "symbol"
618
+ ]
619
+ }
620
+ },
621
+ {
622
+ "name": "get_financials",
623
+ "description": "获取股票财务摘要及历史趋势,按天缓存。A股annual=true与periods=10取十年年报;港股可配置LIXINGER_TOKEN取非金融公司财务序列,保留币种/披露日/实际财年,历史比率单位percent。有效Yahoo顶层快照按整组保留,currency为财报币种、market_cap_currency为市值币种、snapshot_source标明来源;缺失值及report_date不混入历史数值/日期。缺token或无权限降级原有来源并标注不足,不补造缺失。估值历史用get_valuation_history,披露排期用get_earnings_calendar。include_dcf_inputs=true时A/港/美股追加年度DCF输入:美股优先SEC companyfacts,A股/港股配置LIXINGER_TOKEN时优先理杏仁,主源缺失字段按同财年同币种用Yahoo补齐并在field_sources标注,仍缺列入missing_fields;total_debt不含租赁,lease_liabilities单列;不估算。",
624
+ "parameters": {
625
+ "type": "object",
626
+ "properties": {
627
+ "symbol": {
628
+ "type": "string",
629
+ "description": "股票代码(A股如600519,美股如AAPL,港股如00700.HK)"
630
+ },
631
+ "annual": {
632
+ "type": "boolean",
633
+ "description": "只取年度报告,默认false"
634
+ },
635
+ "periods": {
636
+ "type": "number",
637
+ "description": "返回最近N个报告期1..40,默认1;annual=true时periods=10请求10年年报"
638
+ },
639
+ "include_dcf_inputs": {
640
+ "type": "boolean",
641
+ "description": "追加A/港/美股年度DCF输入(收入/EBIT/税/现金流/资本开支/现金/债务/租赁负债/少数股东/股本),默认false"
642
+ }
643
+ },
644
+ "required": [
645
+ "symbol"
646
+ ]
647
+ }
648
+ },
649
+ {
650
+ "name": "get_technical_analysis",
651
+ "description": "获取股票技术面分析(MA/MACD/RSI/BOLL/KDJ/成交量等指标 + 100分综合评分 + 6级买卖信号 + 趋势/偏离度/支撑压力位;附 trend_temperature(实验性EMA差/ATR描述;direction为均线方向;validation_status=not_validated,非星球指标,七档不作入场依据;另附 trend_horizons:21/63/252根日K月度动量,建议count=360,非概率、未验证);多周期共振时 resonance.direction ∈ aligned_bullish/aligned_bearish/divergent)。个股技术面综合判断与买卖时机分析的首选;只要均线数值或自定义周期用 calculate_ma,专问量价用 get_volume_analysis,扫当日异动用 detect_anomaly",
652
+ "parameters": {
653
+ "type": "object",
654
+ "properties": {
655
+ "symbol": {
656
+ "type": "string",
657
+ "description": "股票代码(A股如600519,美股如AAPL,港股如00700.HK)"
658
+ },
659
+ "period": {
660
+ "type": "string",
661
+ "enum": [
662
+ "daily",
663
+ "weekly",
664
+ "monthly"
665
+ ],
666
+ "description": "分析周期,默认 daily"
667
+ },
668
+ "count": {
669
+ "type": "number",
670
+ "description": "用于计算指标的K线条数,默认 120"
671
+ },
672
+ "periods": {
673
+ "type": "string",
674
+ "description": "多周期共振分析,逗号分隔的周期列表,如 \"daily,weekly\";不传则只分析 period 指定的单周期"
675
+ }
676
+ },
677
+ "required": [
678
+ "symbol"
679
+ ]
680
+ }
681
+ },
682
+ {
683
+ "name": "analyze_pattern",
684
+ "description": "K线形态识别 — 检测十字星、锤子线、吞没、启明星、黄昏星、双底、20日突破等12+种经典形态。综合技术面判断用 get_technical_analysis",
685
+ "parameters": {
686
+ "type": "object",
687
+ "properties": {
688
+ "symbol": {
689
+ "type": "string",
690
+ "description": "股票代码(A股如600519,美股如AAPL,港股如00700.HK)"
691
+ },
692
+ "period": {
693
+ "type": "string",
694
+ "enum": [
695
+ "daily",
696
+ "weekly",
697
+ "monthly"
698
+ ],
699
+ "description": "K线周期,默认 daily"
700
+ },
701
+ "days": {
702
+ "type": "number",
703
+ "description": "分析的K线天数,默认 60"
704
+ }
705
+ },
706
+ "required": [
707
+ "symbol"
708
+ ]
709
+ }
710
+ },
711
+ {
712
+ "name": "get_market_indices",
713
+ "description": "获取主要市场指数行情。CN: 上证/深证/创业板/科创50/沪深300;HK: 恒生/国企/科技;US: 道琼斯/纳斯达克/标普500;JP: 日经225/东证;KR: KOSPI/KOSDAQ;TW: 台湾加权。大盘复盘用 get_market_review 一站式获取",
714
+ "parameters": {
715
+ "type": "object",
716
+ "properties": {
717
+ "region": {
718
+ "type": "string",
719
+ "enum": [
720
+ "cn",
721
+ "hk",
722
+ "us",
723
+ "jp",
724
+ "kr",
725
+ "tw"
726
+ ],
727
+ "description": "市场区域,默认 cn"
728
+ }
729
+ }
730
+ }
731
+ },
732
+ {
733
+ "name": "get_sector_rankings",
734
+ "description": "获取板块涨跌幅排行。market=A(默认)为A股板块(含领涨股、涨跌家数等),board_type=industry(默认)为行业、concept为概念;market=US用SPDR行业ETF最近两个收盘作美股11个行业代理(仅industry,proxy字段标注,非交易所官方行业数据)。支持查看涨幅榜/跌幅榜/双向",
735
+ "parameters": {
736
+ "type": "object",
737
+ "properties": {
738
+ "top": {
739
+ "type": "number",
740
+ "description": "返回排名前N的板块,默认 10"
741
+ },
742
+ "direction": {
743
+ "type": "string",
744
+ "enum": [
745
+ "top",
746
+ "bottom",
747
+ "both"
748
+ ],
749
+ "description": "top=涨幅榜(默认),bottom=跌幅榜,both=双向"
750
+ },
751
+ "board_type": {
752
+ "type": "string",
753
+ "enum": [
754
+ "industry",
755
+ "concept"
756
+ ],
757
+ "description": "板块类型:industry=行业(默认),concept=概念"
758
+ },
759
+ "market": {
760
+ "type": "string",
761
+ "enum": [
762
+ "A",
763
+ "US"
764
+ ],
765
+ "description": "市场:A=A股(默认),US=美股行业ETF代理"
766
+ }
767
+ }
768
+ }
769
+ },
770
+ {
771
+ "name": "get_sector_constituents",
772
+ "description": "查询A股板块成分股(正向映射:板块→股票列表)。板块名支持模糊匹配(如「创新药」自动解析到精确板块名),东财行业/概念 + 新浪多源 failover,结果按用户目录缓存7天。仅支持A股;反向查个股所属板块用 resolve_stock_sectors",
773
+ "parameters": {
774
+ "type": "object",
775
+ "properties": {
776
+ "sector": {
777
+ "type": "string",
778
+ "description": "板块名称(可模糊,如 创新药、半导体)"
779
+ },
780
+ "board_type": {
781
+ "type": "string",
782
+ "enum": [
783
+ "industry",
784
+ "concept",
785
+ "auto"
786
+ ],
787
+ "description": "板块类型:industry=行业,concept=概念,auto=自动(默认)"
788
+ }
789
+ },
790
+ "required": [
791
+ "sector"
792
+ ]
793
+ }
794
+ },
795
+ {
796
+ "name": "resolve_stock_sectors",
797
+ "description": "查询个股所属板块(反向映射:个股→板块)。A股返回东财行业 + efinance 概念/板块(雪球行业兜底,需 XUEQIU_TOKEN),港股返回 yfinance GICS 英文 sector/industry 口径。板块级情报(如「创新药回调」)映射到池内个股时调本工具;正向查板块成分股用 get_sector_constituents",
798
+ "parameters": {
799
+ "type": "object",
800
+ "properties": {
801
+ "symbol": {
802
+ "type": "string",
803
+ "description": "股票代码(A股如 600519,港股如 00700.HK)"
804
+ }
805
+ },
806
+ "required": [
807
+ "symbol"
808
+ ]
809
+ }
810
+ },
811
+ {
812
+ "name": "get_stock_info",
813
+ "description": "获取股票基本信息(行业、板块、上市日期、总股本等)。A股返回板块/行业,其他市场返回行业/公司简介",
814
+ "parameters": {
815
+ "type": "object",
816
+ "properties": {
817
+ "symbol": {
818
+ "type": "string",
819
+ "description": "股票代码(A股如600519,美股如AAPL,港股如00700.HK)"
820
+ }
821
+ },
822
+ "required": [
823
+ "symbol"
824
+ ]
825
+ }
826
+ },
827
+ {
828
+ "name": "get_chip_distribution",
829
+ "description": "获取A股筹码分布数据(获利比例、平均成本、90%/70%成本集中度)。仅支持A股。与 get_capital_flow 配合验证主力行为",
830
+ "parameters": {
831
+ "type": "object",
832
+ "properties": {
833
+ "symbol": {
834
+ "type": "string",
835
+ "description": "A股股票代码,如 600519"
836
+ }
837
+ },
838
+ "required": [
839
+ "symbol"
840
+ ]
841
+ }
842
+ },
843
+ {
844
+ "name": "get_market_stats",
845
+ "description": "获取市场整体统计(涨跌家数、中位涨幅、涨跌Top5、总成交额)。market=A(默认)含涨停跌停数;HK/US基于东方财富涨跌排行计数,无涨跌停制度,涨跌停字段与总成交额为null。avg_change_pct恒为null。用于衡量市场整体情绪与温度",
846
+ "parameters": {
847
+ "type": "object",
848
+ "properties": {
849
+ "market": {
850
+ "type": "string",
851
+ "enum": [
852
+ "A",
853
+ "HK",
854
+ "US"
855
+ ],
856
+ "description": "市场:A(默认)/HK/US"
857
+ }
858
+ }
859
+ }
860
+ },
861
+ {
862
+ "name": "get_limit_up_pool",
863
+ "description": "获取A股涨停池/涨停板复盘——当日涨停个股,含连板数、封板资金、炸板次数、首末次封板时间、所属行业。短线情绪与龙头战法核心数据",
864
+ "parameters": {
865
+ "type": "object",
866
+ "properties": {
867
+ "date": {
868
+ "type": "string",
869
+ "description": "日期(YYYYMMDD),默认当日;非交易日或未来日期自动回退到最近交易日(返回含 requested_date 与 stale 标注)"
870
+ }
871
+ }
872
+ }
873
+ },
874
+ {
875
+ "name": "get_dragon_tiger",
876
+ "description": "获取A股龙虎榜——上榜个股净买额/买入额/卖出额/上榜原因/解读,可按个股过滤",
877
+ "parameters": {
878
+ "type": "object",
879
+ "properties": {
880
+ "date": {
881
+ "type": "string",
882
+ "description": "日期(YYYY-MM-DD),默认当日;非交易日或未来日期自动回退到最近交易日(返回含 requested_date 与 stale 标注)"
883
+ },
884
+ "symbol": {
885
+ "type": "string",
886
+ "description": "A股股票代码(可选,按个股过滤),如 600519"
887
+ },
888
+ "top": {
889
+ "type": "number",
890
+ "description": "返回前N条,默认 20"
891
+ }
892
+ }
893
+ }
894
+ },
895
+ {
896
+ "name": "get_hot_stocks",
897
+ "description": "获取A股全市场人气热搜榜(东方财富人气榜)",
898
+ "parameters": {
899
+ "type": "object",
900
+ "properties": {
901
+ "top": {
902
+ "type": "number",
903
+ "description": "返回前N只,默认 20"
904
+ }
905
+ }
906
+ }
907
+ },
908
+ {
909
+ "name": "get_margin_trading",
910
+ "description": "获取A股个股融资融券明细(融资余额/融资买入额/融券余量等,上交所/深交所官方数据按交易所分流),返回最近N个交易日序列(最新在前)。金额单位为元,short_*_shares 单位为股。include_ratio=true追加同日融资买入/成交额百分比(margin_buy_ratio_pct),缺少同日元口径成交额则为null。仅两融标的有数据,非两融标的返回错误",
911
+ "parameters": {
912
+ "type": "object",
913
+ "properties": {
914
+ "symbol": {
915
+ "type": "string",
916
+ "description": "A股股票代码,如 600519"
917
+ },
918
+ "include_ratio": {
919
+ "type": "boolean",
920
+ "description": "追加同日融资买入占比,默认false"
921
+ },
922
+ "days": {
923
+ "type": "number",
924
+ "description": "返回最近N个交易日,默认 10"
925
+ }
926
+ },
927
+ "required": [
928
+ "symbol"
929
+ ]
930
+ }
931
+ },
932
+ {
933
+ "name": "get_northbound_flow",
934
+ "description": "获取北向资金市场级净买入序列(最新在前,单位亿元)。数据口径:东方财富沪深港通历史数据;2024-08-16 起交易所停止披露日度净买额,仅 2024-08 之前历史数据可查(近期小 days 窗口会返回停披错误,加大 days 可取历史)",
935
+ "parameters": {
936
+ "type": "object",
937
+ "properties": {
938
+ "days": {
939
+ "type": "number",
940
+ "description": "返回最近N个交易日,默认 10"
941
+ }
942
+ }
943
+ }
944
+ },
945
+ {
946
+ "name": "get_fundamental_context",
947
+ "description": "获取A股基本面上下文(估值 PE/PB/市值 + 营收/净利增速 + ROE/毛利率/净利率 + 分红历史)。用于评估公司质地与长期持有价值",
948
+ "parameters": {
949
+ "type": "object",
950
+ "properties": {
951
+ "symbol": {
952
+ "type": "string",
953
+ "description": "A股股票代码,如 600519"
954
+ }
955
+ },
956
+ "required": [
957
+ "symbol"
958
+ ]
959
+ }
960
+ },
961
+ {
962
+ "name": "screen_stocks",
963
+ "description": "全市场股票筛选(AlphaSift L1 多因子硬筛 + 市场情绪调节)。按PE/PB/市值/换手率/涨跌幅/量比等因子过滤和评分,流动性分使用成交额turnover(不可作过滤条件),可用 l2 开启质量/成长/动量/波动率/资金流增强。显式筛选条件缺少数据时报error,filters_applied只列实际执行的条件。候选factor_coverage列出可用/缺失因子、加权覆盖率和effective_weights;L1与L2均按可用因子归一化后排序,缺失/非有限值不按零分计;L2另返回effective_scores供结合市场系数复算final,按可用因子重归一化,高分不代表数据完整。选股预算按候选数量及采集批次计算,top须为正整数。",
964
+ "parameters": {
965
+ "type": "object",
966
+ "properties": {
967
+ "market": {
968
+ "type": "string",
969
+ "enum": [
970
+ "A",
971
+ "HK",
972
+ "US"
973
+ ],
974
+ "description": "市场,默认 A"
975
+ },
976
+ "top": {
977
+ "type": "number",
978
+ "description": "返回排名前N的股票,默认 20"
979
+ },
980
+ "config": {
981
+ "type": "string",
982
+ "description": "自定义筛选配置YAML文件路径,不填用默认配置"
983
+ },
984
+ "l2": {
985
+ "type": "boolean",
986
+ "description": "开启L2量化增强(质量/成长/真实动量/波动率/资金流因子,逐股抓取数据较慢),默认关闭"
987
+ }
988
+ }
989
+ }
990
+ },
991
+ {
992
+ "name": "run_backtest",
993
+ "description": "策略回测(AlphaEvo)。读取YAML策略定义,在历史数据上模拟交易,输出收益率/回撤/胜率等指标。只想知道单个技术信号的历史胜率用更轻量的 evaluate_signal。period为实际数据期间,requested_period保留请求期间,warnings提示覆盖差异;年化按实际期间计算。默认前日收盘信号、次日开盘成交;YAML simulation.execution=same_close可复现旧假设。execution返回模型、阻止成交次数和未模拟约束;零成交量及带历史限价的一字板不成交。支持 monthly_momentum:月初首根有效日K收盘观察过去period根对数收益,次日开盘;长周期需预热。",
994
+ "parameters": {
995
+ "type": "object",
996
+ "properties": {
997
+ "strategy": {
998
+ "type": "string",
999
+ "description": "策略YAML文件路径"
1000
+ },
1001
+ "symbol": {
1002
+ "type": "string",
1003
+ "description": "股票代码(A股如600519,美股如AAPL,港股如00700.HK)"
1004
+ },
1005
+ "start": {
1006
+ "type": "string",
1007
+ "description": "回测起始日期,格式 YYYY-MM-DD"
1008
+ },
1009
+ "end": {
1010
+ "type": "string",
1011
+ "description": "回测结束日期,格式 YYYY-MM-DD"
1012
+ },
1013
+ "capital": {
1014
+ "type": "number",
1015
+ "description": "初始资金,默认 1000000"
1016
+ }
1017
+ },
1018
+ "required": [
1019
+ "strategy",
1020
+ "symbol"
1021
+ ]
1022
+ }
1023
+ },
1024
+ {
1025
+ "name": "evaluate_signal",
1026
+ "description": "技术信号历史准确率评估 — 回溯历史数据,统计某个技术信号触发后N日的胜率和平均收益。支持9种信号:macd_golden_cross/macd_death_cross/rsi_oversold/rsi_overbought/breakout_20d/breakdown_20d/volume_surge/ma_golden_cross/ma_death_cross。要完整模拟交易过程用 run_backtest",
1027
+ "parameters": {
1028
+ "type": "object",
1029
+ "properties": {
1030
+ "symbol": {
1031
+ "type": "string",
1032
+ "description": "股票代码(A股如600519,美股如AAPL,港股如00700.HK)"
1033
+ },
1034
+ "signal": {
1035
+ "type": "string",
1036
+ "enum": [
1037
+ "macd_golden_cross",
1038
+ "macd_death_cross",
1039
+ "rsi_oversold",
1040
+ "rsi_overbought",
1041
+ "breakout_20d",
1042
+ "breakdown_20d",
1043
+ "volume_surge",
1044
+ "ma_golden_cross",
1045
+ "ma_death_cross"
1046
+ ],
1047
+ "description": "信号名称"
1048
+ },
1049
+ "forward_days": {
1050
+ "type": "string",
1051
+ "description": "逗号分隔的前瞻天数,默认 3,5,10"
1052
+ },
1053
+ "lookback": {
1054
+ "type": "number",
1055
+ "description": "回溯K线条数,默认 250(约1年)"
1056
+ }
1057
+ },
1058
+ "required": [
1059
+ "symbol",
1060
+ "signal"
1061
+ ]
1062
+ }
1063
+ },
1064
+ {
1065
+ "name": "resolve_stock_name",
1066
+ "description": "股票名称智能解析 — 输入中文名(贵州茅台/腾讯控股/苹果)、拼音或部分代码,返回匹配代码。支持A股、港股和美股;港美数据来自东财名录,单市场失败不影响其他市场。用户给出中文名/拼音/部分代码时先调本工具换成代码再调其他工具",
1067
+ "parameters": {
1068
+ "type": "object",
1069
+ "properties": {
1070
+ "query": {
1071
+ "type": "string",
1072
+ "description": "股票名称、拼音、拼音首字母或部分代码"
1073
+ },
1074
+ "top": {
1075
+ "type": "number",
1076
+ "description": "返回匹配数量,默认 5"
1077
+ }
1078
+ },
1079
+ "required": [
1080
+ "query"
1081
+ ]
1082
+ }
1083
+ },
1084
+ {
1085
+ "name": "check_trading_day",
1086
+ "description": "查询某日是否为交易日。支持CN(A股)、HK(港股)、US(美股)、JP(日股)、KR(韩股)、TW(台股)",
1087
+ "parameters": {
1088
+ "type": "object",
1089
+ "properties": {
1090
+ "market": {
1091
+ "type": "string",
1092
+ "enum": [
1093
+ "CN",
1094
+ "HK",
1095
+ "US",
1096
+ "JP",
1097
+ "KR",
1098
+ "TW"
1099
+ ],
1100
+ "description": "市场"
1101
+ },
1102
+ "date": {
1103
+ "type": "string",
1104
+ "description": "日期(YYYY-MM-DD),不填则查今天"
1105
+ }
1106
+ },
1107
+ "required": [
1108
+ "market"
1109
+ ]
1110
+ }
1111
+ },
1112
+ {
1113
+ "name": "get_trading_days",
1114
+ "description": "获取最近/未来N个交易日列表。支持CN/HK/US/JP/KR/TW;超出日历覆盖的推测日期列入assumed_trading_days,不得当作已确认交易日",
1115
+ "parameters": {
1116
+ "type": "object",
1117
+ "properties": {
1118
+ "market": {
1119
+ "type": "string",
1120
+ "enum": [
1121
+ "CN",
1122
+ "HK",
1123
+ "US",
1124
+ "JP",
1125
+ "KR",
1126
+ "TW"
1127
+ ],
1128
+ "description": "市场"
1129
+ },
1130
+ "direction": {
1131
+ "type": "string",
1132
+ "enum": [
1133
+ "next",
1134
+ "prev"
1135
+ ],
1136
+ "description": "next=未来交易日, prev=过去交易日"
1137
+ },
1138
+ "count": {
1139
+ "type": "number",
1140
+ "description": "返回天数,默认 5"
1141
+ },
1142
+ "date": {
1143
+ "type": "string",
1144
+ "description": "起始日期(YYYY-MM-DD),默认今天"
1145
+ }
1146
+ },
1147
+ "required": [
1148
+ "market"
1149
+ ]
1150
+ }
1151
+ },
1152
+ {
1153
+ "name": "get_trading_phase",
1154
+ "description": "查询某市场当前交易时段(盘前/早盘/午间休市/午盘/交易中/盘后/休市),用于正确解读实时行情的盘中语义。支持CN/HK/US/JP/KR/TW",
1155
+ "parameters": {
1156
+ "type": "object",
1157
+ "properties": {
1158
+ "market": {
1159
+ "type": "string",
1160
+ "enum": [
1161
+ "CN",
1162
+ "HK",
1163
+ "US",
1164
+ "JP",
1165
+ "KR",
1166
+ "TW"
1167
+ ],
1168
+ "description": "市场"
1169
+ }
1170
+ },
1171
+ "required": [
1172
+ "market"
1173
+ ]
1174
+ }
1175
+ },
1176
+ {
1177
+ "name": "calculate_ma",
1178
+ "description": "独立均线计算器 — 支持任意周期MA(5/10/20/30/60/120/250或自定义)+ 偏离度 + 均线排列 + 金叉死叉检测。只要均线数值或需要30/120/250等非默认周期时用本工具;综合技术面分析用 get_technical_analysis",
1179
+ "parameters": {
1180
+ "type": "object",
1181
+ "properties": {
1182
+ "symbol": {
1183
+ "type": "string",
1184
+ "description": "股票代码(A股如600519,美股如AAPL,港股如00700.HK)"
1185
+ },
1186
+ "periods": {
1187
+ "type": "string",
1188
+ "description": "逗号分隔的MA周期列表,如 5,10,20,60,120,250"
1189
+ },
1190
+ "kline_period": {
1191
+ "type": "string",
1192
+ "enum": [
1193
+ "daily",
1194
+ "weekly",
1195
+ "monthly"
1196
+ ],
1197
+ "description": "K线周期,默认 daily"
1198
+ }
1199
+ },
1200
+ "required": [
1201
+ "symbol"
1202
+ ]
1203
+ }
1204
+ },
1205
+ {
1206
+ "name": "get_volume_analysis",
1207
+ "description": "独立量价分析 — 量价相关性、上涨/下跌日成交量对比、量能趋势、量价模式解读(放量上涨/缩量回调等)。综合技术面判断用 get_technical_analysis,扫当日异动用 detect_anomaly",
1208
+ "parameters": {
1209
+ "type": "object",
1210
+ "properties": {
1211
+ "symbol": {
1212
+ "type": "string",
1213
+ "description": "股票代码(A股如600519,美股如AAPL,港股如00700.HK)"
1214
+ },
1215
+ "period": {
1216
+ "type": "string",
1217
+ "enum": [
1218
+ "daily",
1219
+ "weekly",
1220
+ "monthly"
1221
+ ],
1222
+ "description": "K线周期,默认 daily"
1223
+ },
1224
+ "count": {
1225
+ "type": "number",
1226
+ "description": "分析K线条数,默认 60"
1227
+ }
1228
+ },
1229
+ "required": [
1230
+ "symbol"
1231
+ ]
1232
+ }
1233
+ },
1234
+ {
1235
+ "name": "search_stock_news",
1236
+ "description": "多引擎股票新闻搜索(Tavily/Brave/SerpAPI/Bocha/SearXNG)。需配置至少一个搜索源的 Key 或 SearXNG URL。get_news 快讯不够或要按主题搜索时用;深度6维情报用 search_comprehensive_intel",
1237
+ "parameters": {
1238
+ "type": "object",
1239
+ "properties": {
1240
+ "query": {
1241
+ "type": "string",
1242
+ "description": "搜索关键词"
1243
+ },
1244
+ "count": {
1245
+ "type": "number",
1246
+ "description": "返回结果数量,默认 10"
1247
+ }
1248
+ },
1249
+ "required": [
1250
+ "query"
1251
+ ]
1252
+ }
1253
+ },
1254
+ {
1255
+ "name": "search_comprehensive_intel",
1256
+ "description": "股票综合情报搜索 — 从6个维度(新闻/公告/行情分析/风险/业绩/行业)搜索综合信息。用于个股的深入研究/全面调研;快速看新闻用 get_news",
1257
+ "parameters": {
1258
+ "type": "object",
1259
+ "properties": {
1260
+ "symbol": {
1261
+ "type": "string",
1262
+ "description": "股票代码(A股如600519,美股如AAPL,港股如00700.HK)"
1263
+ },
1264
+ "name": {
1265
+ "type": "string",
1266
+ "description": "股票名称(可选,提升搜索准确度)"
1267
+ }
1268
+ },
1269
+ "required": [
1270
+ "symbol"
1271
+ ]
1272
+ }
1273
+ },
1274
+ {
1275
+ "name": "get_social_sentiment",
1276
+ "description": "获取股票社交媒体情绪数据。A股:东方财富股吧热度+雪球讨论热度(无需配置);美股/港股:Reddit/X/Polymarket情绪(需 SENTIMENT_API_KEY)。自动按市场选数据源。面向个股维度;全市场热门讨论用 get_trending_sentiment",
1277
+ "parameters": {
1278
+ "type": "object",
1279
+ "properties": {
1280
+ "symbol": {
1281
+ "type": "string",
1282
+ "description": "股票代码(A股如600519,美股如AAPL,港股如00700.HK)"
1283
+ }
1284
+ },
1285
+ "required": [
1286
+ "symbol"
1287
+ ]
1288
+ }
1289
+ },
1290
+ {
1291
+ "name": "get_trending_sentiment",
1292
+ "description": "获取社交媒体热门趋势(Reddit/X/Polymarket热门股票讨论)。适用于发现市场热点;查个股情绪用 get_social_sentiment",
1293
+ "parameters": {
1294
+ "type": "object",
1295
+ "properties": {}
1296
+ }
1297
+ },
1298
+ {
1299
+ "name": "extract_article",
1300
+ "description": "网页或公告PDF正文提取 — 输入公网URL,提取标题、正文、作者、发布日期等;HTML/PDF默认3000字,可用max_chars调整到200000,PDF最大25MiB。配合 get_news/get_announcements/search_stock_news 与 analyze_disclosure_changes 使用",
1301
+ "parameters": {
1302
+ "type": "object",
1303
+ "properties": {
1304
+ "url": {
1305
+ "type": "string",
1306
+ "description": "文章或公告PDF URL"
1307
+ },
1308
+ "max_chars": {
1309
+ "type": "number",
1310
+ "description": "最多提取字符数,1..200000,默认3000"
1311
+ }
1312
+ },
1313
+ "required": [
1314
+ "url"
1315
+ ]
1316
+ }
1317
+ },
1318
+ {
1319
+ "name": "screen_risk",
1320
+ "description": "A股风险专项筛查 — 检查估值、技术预警、解禁、减持、业绩预警、监管和行业政策,返回风险评级和 veto_buy。新闻搜索命中是待核实线索,不是已证实风险。data_complete和warnings标明覆盖;数据不足时risk_level=unknown,risk_score或veto_buy可为null,不能视为低风险",
1321
+ "parameters": {
1322
+ "type": "object",
1323
+ "properties": {
1324
+ "symbol": {
1325
+ "type": "string",
1326
+ "description": "A股股票代码,如 600519"
1327
+ },
1328
+ "name": {
1329
+ "type": "string",
1330
+ "description": "股票名称(可选,提升新闻搜索准确度)"
1331
+ }
1332
+ },
1333
+ "required": [
1334
+ "symbol"
1335
+ ]
1336
+ }
1337
+ },
1338
+ {
1339
+ "name": "detect_market_regime",
1340
+ "description": "市场状态检测 — 分析A/HK/US/JP/KR/TW大盘指数判断当前市场阶段(上涨趋势/下跌趋势/横盘震荡/高波动),并推荐适合的分析策略;板块热点仅A股,其他市场sector_heat=false",
1341
+ "parameters": {
1342
+ "type": "object",
1343
+ "properties": {
1344
+ "market": {
1345
+ "type": "string",
1346
+ "enum": [
1347
+ "A",
1348
+ "HK",
1349
+ "US",
1350
+ "JP",
1351
+ "KR",
1352
+ "TW"
1353
+ ],
1354
+ "description": "市场代码,默认 A"
1355
+ }
1356
+ }
1357
+ }
1358
+ },
1359
+ {
1360
+ "name": "get_market_review",
1361
+ "description": "大盘复盘 — 获取市场日度复盘数据,包含指数、涨跌统计、板块排名、新闻、市场温度与策略建议。复盘类需求的首选,无需再分别调指数/统计/板块工具。数据不足时温度score及strategy_stance为null,信号unknown;warnings/data_quality说明限制",
1362
+ "parameters": {
1363
+ "type": "object",
1364
+ "properties": {
1365
+ "market": {
1366
+ "type": "string",
1367
+ "enum": [
1368
+ "A",
1369
+ "HK",
1370
+ "US",
1371
+ "all"
1372
+ ],
1373
+ "description": "市场代码,默认 A。all 表示所有市场"
1374
+ }
1375
+ }
1376
+ }
1377
+ },
1378
+ {
1379
+ "name": "get_watchlist",
1380
+ "description": "读取 dsh 仪表盘自选股列表,按保存的首选写法返回 symbols 和 count;600519/sh600519 等价去重。默认读取 ~/.dsh/stock-analysis/watchlist.json,可用 DSH_HOME 或 STOCK_WATCHLIST_FILE 改路径;文件不存在返回空列表,损坏返回错误",
1381
+ "parameters": {
1382
+ "type": "object",
1383
+ "properties": {}
1384
+ }
1385
+ },
1386
+ {
1387
+ "name": "run_watchlist_analysis",
1388
+ "description": "批量自选股分析 — 对多只股票并行采集行情/技术/资金/风险等数据,返回汇总结果。适用于每日定时分析自选股列表",
1389
+ "parameters": {
1390
+ "type": "object",
1391
+ "properties": {
1392
+ "symbols": {
1393
+ "type": "string",
1394
+ "description": "逗号分隔的股票代码列表,如 600519,000001,300750"
1395
+ },
1396
+ "workers": {
1397
+ "type": "number",
1398
+ "description": "并发数,默认 3(建议不超过5,避免API限流)"
1399
+ }
1400
+ },
1401
+ "required": [
1402
+ "symbols"
1403
+ ]
1404
+ }
1405
+ },
1406
+ {
1407
+ "name": "detect_anomaly",
1408
+ "description": "异常/事件检测 — 一键扫描股票当前所有异动信号(MACD金叉死叉、RSI超买超卖、20日突破、放量异动、涨跌停、布林突破、KDJ极值、资金异动等),返回结构化异常列表。当日异动归因的首选;综合技术面判断用 get_technical_analysis",
1409
+ "parameters": {
1410
+ "type": "object",
1411
+ "properties": {
1412
+ "symbol": {
1413
+ "type": "string",
1414
+ "description": "股票代码(A股如600519,美股如AAPL,港股如00700.HK)"
1415
+ }
1416
+ },
1417
+ "required": [
1418
+ "symbol"
1419
+ ]
1420
+ }
1421
+ },
1422
+ {
1423
+ "name": "diagnose_data_sources",
1424
+ "description": "数据源诊断 — 检查当前环境各数据 provider 的包与凭据就绪情况(不探测网络可达性),输出每个市场的可用链路、缺失 env、warnings。工具拿不到数据或报错时调用排查",
1425
+ "parameters": {
1426
+ "type": "object",
1427
+ "properties": {
1428
+ "market": {
1429
+ "type": "string",
1430
+ "enum": [
1431
+ "A",
1432
+ "HK",
1433
+ "US",
1434
+ "JP",
1435
+ "KR",
1436
+ "TW",
1437
+ "all"
1438
+ ],
1439
+ "description": "市场,默认 all"
1440
+ }
1441
+ }
1442
+ }
1443
+ },
1444
+ {
1445
+ "name": "get_market_capabilities",
1446
+ "description": "市场能力边界 — 返回指定市场支持/不支持的工具列表。不确定某市场能否用某工具(如港股的筹码分布、美股的资金流)时先调本工具,避免调用不支持的工具后编造数据",
1447
+ "parameters": {
1448
+ "type": "object",
1449
+ "properties": {
1450
+ "market": {
1451
+ "type": "string",
1452
+ "enum": [
1453
+ "A",
1454
+ "HK",
1455
+ "US",
1456
+ "JP",
1457
+ "KR",
1458
+ "TW"
1459
+ ],
1460
+ "description": "市场代码"
1461
+ },
1462
+ "symbol": {
1463
+ "type": "string",
1464
+ "description": "股票代码(自动识别市场,与 market 二选一)"
1465
+ }
1466
+ }
1467
+ }
1468
+ },
1469
+ {
1470
+ "name": "render_stock_report",
1471
+ "description": "股票分析报告渲染 — 将结构化报告 JSON 通过 j2 模板渲染为 Markdown。report 字段以 skill 提供的 report_schema 为准,不要自造字段。template: brief|full。全部分析完成后的最后一步调用。默认仅渲染;final=true表示最终回复,支持直出的宿主可原样交付并结束本轮。report可包含evidence(path/label/value/source/as_of)与data_quality(flags/limitations),brief/full均展示证据和限制。",
1472
+ "parameters": {
1473
+ "type": "object",
1474
+ "properties": {
1475
+ "final": {
1476
+ "type": "boolean",
1477
+ "description": "最终回复标记,默认false;保存附件或继续分析时保持false"
1478
+ },
1479
+ "report": {
1480
+ "type": "object",
1481
+ "additionalProperties": true,
1482
+ "description": "结构化股票报告 JSON"
1483
+ },
1484
+ "template": {
1485
+ "type": "string",
1486
+ "enum": [
1487
+ "brief",
1488
+ "full"
1489
+ ],
1490
+ "description": "模板类型,默认 full"
1491
+ }
1492
+ },
1493
+ "required": [
1494
+ "report"
1495
+ ]
1496
+ }
1497
+ },
1498
+ {
1499
+ "name": "render_market_report",
1500
+ "description": "大盘复盘报告渲染 — 将结构化报告 JSON 通过 j2 模板渲染为 Markdown。report 字段以 schemas/market_review_schema.json 为准。save=true 时把报告对象追加归档到本地 JSONL(默认不保存不推送),纵向对比用 get_review_history;final=true仅用于最终回复,保存附件或继续分析时保持false",
1501
+ "parameters": {
1502
+ "type": "object",
1503
+ "properties": {
1504
+ "final": {
1505
+ "type": "boolean",
1506
+ "description": "最终回复标记,默认false;保存附件或继续分析时保持false"
1507
+ },
1508
+ "report": {
1509
+ "type": "object",
1510
+ "additionalProperties": true,
1511
+ "description": "结构化市场复盘"
1512
+ },
1513
+ "save": {
1514
+ "type": "boolean",
1515
+ "description": "是否归档到本地复盘 JSONL 存储,默认 false"
1516
+ }
1517
+ },
1518
+ "required": [
1519
+ "report"
1520
+ ]
1521
+ }
1522
+ },
1523
+ {
1524
+ "name": "get_review_history",
1525
+ "description": "复盘归档历史 — 读取本地 JSONL 归档的最近 N 条市场复盘(最新在前),用于纵向对比(温度/姿态/主线变化)。归档由 render_market_report 的 save=true 写入,空存档返回空列表",
1526
+ "parameters": {
1527
+ "type": "object",
1528
+ "properties": {
1529
+ "limit": {
1530
+ "type": "number",
1531
+ "description": "返回条数,默认 10"
1532
+ }
1533
+ }
1534
+ }
1535
+ },
1536
+ {
1537
+ "name": "build_watchlist_context",
1538
+ "description": "自选股上下文包 — 对多只股票输出评分/趋势/异常/风险/建议 next_tools 的 agent 友好摘要。宿主 agent 决定如何写日报或深入分析。异动检查失败时anomaly_status=unavailable、anomaly_count=null,保留anomaly_error/warnings;汇总计入partial",
1539
+ "parameters": {
1540
+ "type": "object",
1541
+ "properties": {
1542
+ "symbols": {
1543
+ "type": "string",
1544
+ "description": "逗号分隔的股票代码列表"
1545
+ },
1546
+ "include_market_review": {
1547
+ "type": "boolean",
1548
+ "description": "是否附带各市场复盘,默认 false"
1549
+ },
1550
+ "workers": {
1551
+ "type": "number",
1552
+ "description": "并发数,默认 3"
1553
+ }
1554
+ },
1555
+ "required": [
1556
+ "symbols"
1557
+ ]
1558
+ }
1559
+ },
1560
+ {
1561
+ "name": "analyze_position_context",
1562
+ "description": "持仓上下文分析 — 输入成本/仓位/止损止盈,结合现价和技术位输出浮盈亏、离止损距离、风险级别、操作建议。无状态、不存账户",
1563
+ "parameters": {
1564
+ "type": "object",
1565
+ "properties": {
1566
+ "symbol": {
1567
+ "type": "string",
1568
+ "description": "股票代码(A股如600519,美股如AAPL,港股如00700.HK)"
1569
+ },
1570
+ "cost": {
1571
+ "type": "number",
1572
+ "description": "成本价"
1573
+ },
1574
+ "quantity": {
1575
+ "type": "number",
1576
+ "description": "持仓数量"
1577
+ },
1578
+ "stop_loss": {
1579
+ "type": "number",
1580
+ "description": "止损价"
1581
+ },
1582
+ "take_profit": {
1583
+ "type": "number",
1584
+ "description": "止盈价"
1585
+ }
1586
+ },
1587
+ "required": [
1588
+ "symbol",
1589
+ "cost",
1590
+ "quantity"
1591
+ ]
1592
+ }
1593
+ },
1594
+ {
1595
+ "name": "check_alert_rules",
1596
+ "description": "无状态告警规则检查 — 传入规则数组,返回当前是否触发。规则类型:price_below/price_above/change_pct_above/change_pct_below/volume_ratio_above/anomaly/risk_veto/risk_level_at_least。不做调度不存历史。依赖数据不可用时evaluated条目含error,meta.warnings提示缺失,triggered=false不代表检查成功",
1597
+ "parameters": {
1598
+ "type": "object",
1599
+ "properties": {
1600
+ "symbol": {
1601
+ "type": "string",
1602
+ "description": "股票代码(A股如600519,美股如AAPL,港股如00700.HK)"
1603
+ },
1604
+ "rules": {
1605
+ "type": "array",
1606
+ "description": "规则列表,每项 { type, value }",
1607
+ "items": {
1608
+ "type": "object",
1609
+ "properties": {
1610
+ "type": {
1611
+ "type": "string"
1612
+ },
1613
+ "value": {}
1614
+ }
1615
+ }
1616
+ }
1617
+ },
1618
+ "required": [
1619
+ "symbol",
1620
+ "rules"
1621
+ ]
1622
+ }
1623
+ },
1624
+ {
1625
+ "name": "record_signal",
1626
+ "description": "记录一条 AI 分析建议信号(方向/入场价/目标价/止损价/持有期限),供后续胜率评估。信号持久化在本地 JSONL($STOCK_SIGNAL_STORE 或 ~/.stock-analysis/signals.jsonl),宿主 Agent 自行决定何时 record/evaluate",
1627
+ "parameters": {
1628
+ "type": "object",
1629
+ "properties": {
1630
+ "symbol": {
1631
+ "type": "string",
1632
+ "description": "股票代码(A股如600519,美股如AAPL,港股如00700.HK)"
1633
+ },
1634
+ "direction": {
1635
+ "type": "string",
1636
+ "enum": [
1637
+ "buy",
1638
+ "sell"
1639
+ ],
1640
+ "description": "建议方向"
1641
+ },
1642
+ "entry_price": {
1643
+ "type": "number",
1644
+ "description": "入场价(可选)"
1645
+ },
1646
+ "target_price": {
1647
+ "type": "number",
1648
+ "description": "目标价(可选)"
1649
+ },
1650
+ "stop_price": {
1651
+ "type": "number",
1652
+ "description": "止损价(可选)"
1653
+ },
1654
+ "horizon_days": {
1655
+ "type": "number",
1656
+ "description": "持有期限(交易日),默认 10"
1657
+ },
1658
+ "source": {
1659
+ "type": "string",
1660
+ "description": "信号来源(如触发该建议的 skill 名)"
1661
+ },
1662
+ "note": {
1663
+ "type": "string",
1664
+ "description": "备注(可选)"
1665
+ }
1666
+ },
1667
+ "required": [
1668
+ "symbol",
1669
+ "direction"
1670
+ ]
1671
+ }
1672
+ },
1673
+ {
1674
+ "name": "evaluate_signals",
1675
+ "description": "评估到期信号:拉取记录日之后的日K,判定 target_hit/stop_hit/timeout 并计算收益,回写存储。记录建议用 record_signal,胜率复盘用 get_signal_summary。历史K线未覆盖记录日时skipped_no_data并保持未结算,不能用较新行情代替。原始信号价与复权K线须有可核实的adjustment_factor,缺失则skipped_price_basis保持未结算。CLI预算300秒,截止前返回并保存已完成结果;complete/deferred/warnings说明未处理记录,下次可重试",
1676
+ "parameters": {
1677
+ "type": "object",
1678
+ "properties": {
1679
+ "symbol": {
1680
+ "type": "string",
1681
+ "description": "股票代码(可选,只评估该股的信号)"
1682
+ }
1683
+ }
1684
+ }
1685
+ },
1686
+ {
1687
+ "name": "get_signal_summary",
1688
+ "description": "信号胜率汇总(可按 source/symbol/status 过滤):胜率、平均收益、结果分布与明细。by_source附avg_return_pct、return_samples和sample_warning;仅观察性复盘,样本少不能认定策略有效。",
1689
+ "parameters": {
1690
+ "type": "object",
1691
+ "properties": {
1692
+ "source": {
1693
+ "type": "string",
1694
+ "description": "按信号来源过滤(可选)"
1695
+ },
1696
+ "symbol": {
1697
+ "type": "string",
1698
+ "description": "按股票代码过滤(可选)"
1699
+ },
1700
+ "status": {
1701
+ "type": "string",
1702
+ "enum": [
1703
+ "open",
1704
+ "closed",
1705
+ "all"
1706
+ ],
1707
+ "description": "open=未结算,closed=已结算,all=全部(默认)"
1708
+ }
1709
+ }
1710
+ }
1711
+ },
1712
+ {
1713
+ "name": "parse_stock_list",
1714
+ "description": "自选股/文本导入解析 — 从自然语言、CSV、Markdown 表格提取股票,自动识别 A 股 6 位代码、港股 xxxxx.HK、美股 ticker、日股 xxxx.T、韩股 xxxxxx.KS/KQ、台股 xxxx.TW,并调用 name_resolver 处理中文股票名(支持A/HK/US)",
1715
+ "parameters": {
1716
+ "type": "object",
1717
+ "properties": {
1718
+ "text": {
1719
+ "type": "string",
1720
+ "description": "待解析的文本"
1721
+ }
1722
+ },
1723
+ "required": [
1724
+ "text"
1725
+ ]
1726
+ }
1727
+ },
1728
+ {
1729
+ "name": "compare_stocks",
1730
+ "description": "无状态同行指标比较:先用现有财务/行情工具取数,再传companies;仅相同unit/basis/period可排序,缺失不填零,不生成买卖综合分。",
1731
+ "parameters": {
1732
+ "type": "object",
1733
+ "properties": {
1734
+ "companies": {
1735
+ "type": "array",
1736
+ "items": {
1737
+ "type": "object",
1738
+ "properties": {
1739
+ "symbol": {
1740
+ "type": "string",
1741
+ "description": "唯一股票代码"
1742
+ },
1743
+ "period": {
1744
+ "type": "string",
1745
+ "description": "统一可比期间;财务用报告期,估值用估值日"
1746
+ },
1747
+ "metrics": {
1748
+ "type": "array",
1749
+ "items": {
1750
+ "type": "object",
1751
+ "properties": {
1752
+ "name": {
1753
+ "type": "string",
1754
+ "description": "指标名,如pe/roe/net_income"
1755
+ },
1756
+ "value": {
1757
+ "anyOf": [
1758
+ {
1759
+ "type": "number"
1760
+ },
1761
+ {
1762
+ "type": "null"
1763
+ }
1764
+ ],
1765
+ "description": "有限数值;缺失为null"
1766
+ },
1767
+ "unit": {
1768
+ "type": "string",
1769
+ "description": "精确单位,如multiple/percent/fraction/CNY/USD"
1770
+ },
1771
+ "basis": {
1772
+ "type": "string",
1773
+ "description": "口径,如TTM/annual/consolidated;区分累计与单季"
1774
+ },
1775
+ "source": {
1776
+ "type": "string",
1777
+ "description": "原始证据URL或字段路径"
1778
+ }
1779
+ },
1780
+ "required": [
1781
+ "name",
1782
+ "value",
1783
+ "unit",
1784
+ "basis"
1785
+ ],
1786
+ "additionalProperties": false
1787
+ },
1788
+ "description": "结构化指标,单位、口径明确,缺失不填零"
1789
+ }
1790
+ },
1791
+ "required": [
1792
+ "symbol",
1793
+ "period",
1794
+ "metrics"
1795
+ ],
1796
+ "additionalProperties": false
1797
+ },
1798
+ "description": "2..30家公司,调用方确认可比性"
1799
+ }
1800
+ },
1801
+ "required": [
1802
+ "companies"
1803
+ ],
1804
+ "additionalProperties": false
1805
+ }
1806
+ },
1807
+ {
1808
+ "name": "analyze_disclosure_changes",
1809
+ "description": "无状态公告财报比较:传新旧正文及指标,返回变更行号、来源与财务变化;负/零基数增长率为null。不下载PDF、不代替经济解读。",
1810
+ "parameters": {
1811
+ "type": "object",
1812
+ "properties": {
1813
+ "previous": {
1814
+ "type": "object",
1815
+ "properties": {
1816
+ "text": {
1817
+ "type": "string",
1818
+ "description": "已核实正文,最多200000字符;保留换行,PDF需宿主提取"
1819
+ },
1820
+ "source": {
1821
+ "type": "string",
1822
+ "description": "原文URL或文档标识"
1823
+ },
1824
+ "period": {
1825
+ "type": "string",
1826
+ "description": "报告期,如2025年度"
1827
+ },
1828
+ "metrics": {
1829
+ "type": "array",
1830
+ "items": {
1831
+ "type": "object",
1832
+ "properties": {
1833
+ "name": {
1834
+ "type": "string",
1835
+ "description": "指标名,如pe/roe/net_income"
1836
+ },
1837
+ "value": {
1838
+ "anyOf": [
1839
+ {
1840
+ "type": "number"
1841
+ },
1842
+ {
1843
+ "type": "null"
1844
+ }
1845
+ ],
1846
+ "description": "有限数值;缺失为null"
1847
+ },
1848
+ "unit": {
1849
+ "type": "string",
1850
+ "description": "精确单位,如multiple/percent/fraction/CNY/USD"
1851
+ },
1852
+ "basis": {
1853
+ "type": "string",
1854
+ "description": "口径,如TTM/annual/consolidated;区分累计与单季"
1855
+ },
1856
+ "source": {
1857
+ "type": "string",
1858
+ "description": "原始证据URL或字段路径"
1859
+ }
1860
+ },
1861
+ "required": [
1862
+ "name",
1863
+ "value",
1864
+ "unit",
1865
+ "basis"
1866
+ ],
1867
+ "additionalProperties": false
1868
+ },
1869
+ "description": "结构化指标,单位、口径明确,缺失不填零"
1870
+ }
1871
+ },
1872
+ "required": [
1873
+ "text",
1874
+ "source",
1875
+ "period",
1876
+ "metrics"
1877
+ ],
1878
+ "additionalProperties": false
1879
+ },
1880
+ "current": {
1881
+ "type": "object",
1882
+ "properties": {
1883
+ "text": {
1884
+ "type": "string",
1885
+ "description": "已核实正文,最多200000字符;保留换行,PDF需宿主提取"
1886
+ },
1887
+ "source": {
1888
+ "type": "string",
1889
+ "description": "原文URL或文档标识"
1890
+ },
1891
+ "period": {
1892
+ "type": "string",
1893
+ "description": "报告期,如2025年度"
1894
+ },
1895
+ "metrics": {
1896
+ "type": "array",
1897
+ "items": {
1898
+ "type": "object",
1899
+ "properties": {
1900
+ "name": {
1901
+ "type": "string",
1902
+ "description": "指标名,如pe/roe/net_income"
1903
+ },
1904
+ "value": {
1905
+ "anyOf": [
1906
+ {
1907
+ "type": "number"
1908
+ },
1909
+ {
1910
+ "type": "null"
1911
+ }
1912
+ ],
1913
+ "description": "有限数值;缺失为null"
1914
+ },
1915
+ "unit": {
1916
+ "type": "string",
1917
+ "description": "精确单位,如multiple/percent/fraction/CNY/USD"
1918
+ },
1919
+ "basis": {
1920
+ "type": "string",
1921
+ "description": "口径,如TTM/annual/consolidated;区分累计与单季"
1922
+ },
1923
+ "source": {
1924
+ "type": "string",
1925
+ "description": "原始证据URL或字段路径"
1926
+ }
1927
+ },
1928
+ "required": [
1929
+ "name",
1930
+ "value",
1931
+ "unit",
1932
+ "basis"
1933
+ ],
1934
+ "additionalProperties": false
1935
+ },
1936
+ "description": "结构化指标,单位、口径明确,缺失不填零"
1937
+ }
1938
+ },
1939
+ "required": [
1940
+ "text",
1941
+ "source",
1942
+ "period",
1943
+ "metrics"
1944
+ ],
1945
+ "additionalProperties": false
1946
+ },
1947
+ "max_changes": {
1948
+ "type": "number",
1949
+ "description": "变化上限1..100,默认30"
1950
+ }
1951
+ },
1952
+ "required": [
1953
+ "previous",
1954
+ "current"
1955
+ ],
1956
+ "additionalProperties": false
1957
+ }
1958
+ },
1959
+ {
1960
+ "name": "analyze_portfolio_risk",
1961
+ "description": "无状态现货多头组合风险与压力测试:输入持仓、基准币种现金与汇率,返回集中度、币种/行业敞口、价格盈亏、止损情景及可选市场/行业/个股/汇率冲击损益。缺汇率报错;不保存账户。",
1962
+ "parameters": {
1963
+ "type": "object",
1964
+ "properties": {
1965
+ "positions": {
1966
+ "type": "array",
1967
+ "items": {
1968
+ "type": "object",
1969
+ "properties": {
1970
+ "symbol": {
1971
+ "type": "string",
1972
+ "description": "唯一代码,重复持仓先汇总"
1973
+ },
1974
+ "quantity": {
1975
+ "type": "number",
1976
+ "description": "正持仓数量"
1977
+ },
1978
+ "price": {
1979
+ "type": "number",
1980
+ "description": "正现价"
1981
+ },
1982
+ "currency": {
1983
+ "type": "string",
1984
+ "description": "持仓币种,如CNY/USD/HKD"
1985
+ },
1986
+ "cost": {
1987
+ "type": "number",
1988
+ "description": "同币种正成本价,可选"
1989
+ },
1990
+ "stop_price": {
1991
+ "type": "number",
1992
+ "description": "同币种正止损价,可选"
1993
+ },
1994
+ "sector": {
1995
+ "type": "string",
1996
+ "description": "统一行业分类,可选"
1997
+ },
1998
+ "as_of": {
1999
+ "type": "string",
2000
+ "description": "实际估值时点,建议ISO8601"
2001
+ }
2002
+ },
2003
+ "required": [
2004
+ "symbol",
2005
+ "quantity",
2006
+ "price",
2007
+ "currency"
2008
+ ],
2009
+ "additionalProperties": false
2010
+ },
2011
+ "description": "1..100个现货多头持仓"
2012
+ },
2013
+ "base_currency": {
2014
+ "type": "string",
2015
+ "description": "基准币种"
2016
+ },
2017
+ "cash": {
2018
+ "type": "number",
2019
+ "description": "基准币种现金,非负"
2020
+ },
2021
+ "fx_rates": {
2022
+ "type": "array",
2023
+ "items": {
2024
+ "type": "object",
2025
+ "properties": {
2026
+ "currency": {
2027
+ "type": "string",
2028
+ "description": "唯一非基准币种"
2029
+ },
2030
+ "rate": {
2031
+ "type": "number",
2032
+ "description": "一单位该币种对应多少基准币种,正数"
2033
+ }
2034
+ },
2035
+ "required": [
2036
+ "currency",
2037
+ "rate"
2038
+ ],
2039
+ "additionalProperties": false
2040
+ },
2041
+ "description": "显式现价汇率;基准币种隐含1,不得重复"
2042
+ },
2043
+ "histories": {
2044
+ "type": "array",
2045
+ "items": {
2046
+ "type": "object",
2047
+ "properties": {
2048
+ "symbol": {
2049
+ "type": "string",
2050
+ "description": "对应唯一持仓股票"
2051
+ },
2052
+ "prices": {
2053
+ "type": "array",
2054
+ "items": {
2055
+ "type": "object",
2056
+ "properties": {
2057
+ "date": {
2058
+ "type": "string",
2059
+ "description": "YYYY-MM-DD,唯一日期"
2060
+ },
2061
+ "close": {
2062
+ "type": "number",
2063
+ "description": "正有限收盘价"
2064
+ }
2065
+ },
2066
+ "required": [
2067
+ "date",
2068
+ "close"
2069
+ ],
2070
+ "additionalProperties": false
2071
+ },
2072
+ "description": "完整日K收盘序列,2..20000条,不得跨股票或混用复权口径"
2073
+ }
2074
+ },
2075
+ "required": [
2076
+ "symbol",
2077
+ "prices"
2078
+ ],
2079
+ "additionalProperties": false
2080
+ },
2081
+ "description": "可选历史,共同日期本币价格收益相关性,不计汇率"
2082
+ },
2083
+ "stress_scenarios": {
2084
+ "type": "array",
2085
+ "items": {
2086
+ "type": "object",
2087
+ "properties": {
2088
+ "name": {
2089
+ "type": "string",
2090
+ "description": "情景名称"
2091
+ },
2092
+ "market_shock": {
2093
+ "type": "number",
2094
+ "description": "全市场资产价格冲击比例,如-0.1"
2095
+ },
2096
+ "sector_shocks": {
2097
+ "type": "array",
2098
+ "items": {
2099
+ "type": "object",
2100
+ "properties": {
2101
+ "sector": {
2102
+ "type": "string",
2103
+ "description": "与持仓一致的行业名称"
2104
+ },
2105
+ "shock": {
2106
+ "type": "number",
2107
+ "description": "行业价格冲击比例"
2108
+ }
2109
+ },
2110
+ "required": [
2111
+ "sector",
2112
+ "shock"
2113
+ ],
2114
+ "additionalProperties": false
2115
+ },
2116
+ "description": "可选行业冲击"
2117
+ },
2118
+ "symbol_shocks": {
2119
+ "type": "array",
2120
+ "items": {
2121
+ "type": "object",
2122
+ "properties": {
2123
+ "symbol": {
2124
+ "type": "string",
2125
+ "description": "持仓标的代码"
2126
+ },
2127
+ "shock": {
2128
+ "type": "number",
2129
+ "description": "标的价格冲击比例"
2130
+ }
2131
+ },
2132
+ "required": [
2133
+ "symbol",
2134
+ "shock"
2135
+ ],
2136
+ "additionalProperties": false
2137
+ },
2138
+ "description": "可选个股冲击"
2139
+ },
2140
+ "currency_shocks": {
2141
+ "type": "array",
2142
+ "items": {
2143
+ "type": "object",
2144
+ "properties": {
2145
+ "currency": {
2146
+ "type": "string",
2147
+ "description": "持仓中的非基准币种;基准币种不可相对自身冲击"
2148
+ },
2149
+ "shock": {
2150
+ "type": "number",
2151
+ "description": "相对基准币种的汇率冲击比例"
2152
+ }
2153
+ },
2154
+ "required": [
2155
+ "currency",
2156
+ "shock"
2157
+ ],
2158
+ "additionalProperties": false
2159
+ },
2160
+ "description": "可选汇率冲击"
2161
+ }
2162
+ },
2163
+ "required": [
2164
+ "name"
2165
+ ],
2166
+ "additionalProperties": false
2167
+ },
2168
+ "description": "可选压力情景;所有冲击均为比例,由共享核心计算"
2169
+ }
2170
+ },
2171
+ "required": [
2172
+ "positions",
2173
+ "base_currency",
2174
+ "cash"
2175
+ ],
2176
+ "additionalProperties": false
2177
+ }
2178
+ },
2179
+ {
2180
+ "name": "plan_portfolio_rebalance",
2181
+ "description": "无状态组合调仓计划:按当前持仓、目标权重、现金、汇率、整手、费用和换手约束生成先卖后买清单;不保存账户或提交订单。",
2182
+ "parameters": {
2183
+ "type": "object",
2184
+ "properties": {
2185
+ "base_currency": {
2186
+ "type": "string",
2187
+ "description": "基准币种"
2188
+ },
2189
+ "cash": {
2190
+ "type": "number",
2191
+ "description": "基准币种现金,非负"
2192
+ },
2193
+ "positions": {
2194
+ "type": "array",
2195
+ "items": {
2196
+ "type": "object",
2197
+ "properties": {
2198
+ "symbol": {
2199
+ "type": "string",
2200
+ "description": "唯一代码,重复持仓先汇总"
2201
+ },
2202
+ "quantity": {
2203
+ "type": "number",
2204
+ "description": "正持仓数量"
2205
+ },
2206
+ "price": {
2207
+ "type": "number",
2208
+ "description": "正现价"
2209
+ },
2210
+ "currency": {
2211
+ "type": "string",
2212
+ "description": "持仓币种,如CNY/USD/HKD"
2213
+ },
2214
+ "cost": {
2215
+ "type": "number",
2216
+ "description": "同币种正成本价,可选;调仓计算不使用"
2217
+ },
2218
+ "stop_price": {
2219
+ "type": "number",
2220
+ "description": "同币种正止损价,可选;调仓计算不使用"
2221
+ },
2222
+ "sector": {
2223
+ "type": "string",
2224
+ "description": "统一行业分类,可选"
2225
+ },
2226
+ "as_of": {
2227
+ "type": "string",
2228
+ "description": "实际估值时点,建议ISO8601"
2229
+ }
2230
+ },
2231
+ "required": [
2232
+ "symbol",
2233
+ "quantity",
2234
+ "price",
2235
+ "currency"
2236
+ ],
2237
+ "additionalProperties": false
2238
+ },
2239
+ "description": "0..100个现货多头持仓,空数组表示纯现金建仓"
2240
+ },
2241
+ "targets": {
2242
+ "type": "array",
2243
+ "items": {
2244
+ "type": "object",
2245
+ "properties": {
2246
+ "symbol": {
2247
+ "type": "string",
2248
+ "description": "目标标的代码"
2249
+ },
2250
+ "weight": {
2251
+ "type": "number",
2252
+ "description": "目标权重;大于0时lot_size必填"
2253
+ },
2254
+ "price": {
2255
+ "type": "number",
2256
+ "description": "正目标价格;当前未持有的新标的必填"
2257
+ },
2258
+ "currency": {
2259
+ "type": "string",
2260
+ "description": "目标币种;当前未持有的新标的必填"
2261
+ },
2262
+ "sector": {
2263
+ "type": "string",
2264
+ "description": "统一行业分类,可选"
2265
+ },
2266
+ "as_of": {
2267
+ "type": "string",
2268
+ "description": "实际估值时点,建议ISO8601"
2269
+ },
2270
+ "lot_size": {
2271
+ "type": "number",
2272
+ "description": "正整数交易单位;weight>0时必填"
2273
+ }
2274
+ },
2275
+ "required": [
2276
+ "symbol",
2277
+ "weight"
2278
+ ],
2279
+ "additionalProperties": false
2280
+ },
2281
+ "description": "1..100个目标;新标的price/currency必填"
2282
+ },
2283
+ "fx_rates": {
2284
+ "type": "array",
2285
+ "items": {
2286
+ "type": "object",
2287
+ "properties": {
2288
+ "currency": {
2289
+ "type": "string",
2290
+ "description": "唯一非基准币种"
2291
+ },
2292
+ "rate": {
2293
+ "type": "number",
2294
+ "description": "一单位该币种对应多少基准币种,正数"
2295
+ }
2296
+ },
2297
+ "required": [
2298
+ "currency",
2299
+ "rate"
2300
+ ],
2301
+ "additionalProperties": false
2302
+ },
2303
+ "description": "显式现价汇率;基准币种隐含1,不得重复"
2304
+ },
2305
+ "fee_rate": {
2306
+ "type": "number",
2307
+ "description": "每边比例费用0..0.1,默认0;不含未提供税费/最低收费"
2308
+ },
2309
+ "slippage_rate": {
2310
+ "type": "number",
2311
+ "description": "每边滑点0..0.1,默认0"
2312
+ },
2313
+ "max_turnover_fraction": {
2314
+ "type": "number",
2315
+ "description": "非负最大总换手,按买卖参考金额合计/初始权益;默认不限制,可大于1"
2316
+ }
2317
+ },
2318
+ "required": [
2319
+ "base_currency",
2320
+ "cash",
2321
+ "positions",
2322
+ "targets"
2323
+ ],
2324
+ "additionalProperties": false
2325
+ }
2326
+ },
2327
+ {
2328
+ "name": "calculate_position_size",
2329
+ "description": "无状态多头仓位预算:同币种金额,按现金/风险预算/最大仓位/交易单位取最小数量,双边费用和滑点参与止损情景;不执行交易。",
2330
+ "parameters": {
2331
+ "type": "object",
2332
+ "properties": {
2333
+ "equity": {
2334
+ "type": "number",
2335
+ "description": "总权益,正数"
2336
+ },
2337
+ "cash": {
2338
+ "type": "number",
2339
+ "description": "可用现金,0..equity"
2340
+ },
2341
+ "entry_price": {
2342
+ "type": "number",
2343
+ "description": "计划入场价,正数"
2344
+ },
2345
+ "stop_price": {
2346
+ "type": "number",
2347
+ "description": "正止损价,低于入场价"
2348
+ },
2349
+ "risk_fraction": {
2350
+ "type": "number",
2351
+ "description": "单笔风险占权益比例0..1,如0.01"
2352
+ },
2353
+ "lot_size": {
2354
+ "type": "number",
2355
+ "description": "正整数交易单位,用户确认,不猜港股每手数量"
2356
+ },
2357
+ "max_position_fraction": {
2358
+ "type": "number",
2359
+ "description": "本次买入最大资金占比0..1,默认1;已有同股持仓先扣减额度"
2360
+ },
2361
+ "fee_rate": {
2362
+ "type": "number",
2363
+ "description": "每边比例费用0..0.1,默认0;不含未提供税费/最低收费"
2364
+ },
2365
+ "slippage_rate": {
2366
+ "type": "number",
2367
+ "description": "每边滑点0..0.1,默认0"
2368
+ }
2369
+ },
2370
+ "required": [
2371
+ "equity",
2372
+ "cash",
2373
+ "entry_price",
2374
+ "stop_price",
2375
+ "risk_fraction",
2376
+ "lot_size"
2377
+ ],
2378
+ "additionalProperties": false
2379
+ }
2380
+ },
2381
+ {
2382
+ "name": "calculate_dcf_valuation",
2383
+ "description": "无状态达摩达兰式FCFF DCF:输入收入、增长、营业利润率、税率、销售资本比、逐年WACC、永续增长与ROIC及股权桥,输出企业价值、股权价值、每股价值、终值占比和3x3敏感性;不取数、不估WACC、不生成买卖信号。",
2384
+ "parameters": {
2385
+ "type": "object",
2386
+ "properties": {
2387
+ "currency": {
2388
+ "type": "string",
2389
+ "description": "所有金额统一币种,如USD/HKD/CNY"
2390
+ },
2391
+ "units": {
2392
+ "type": "string",
2393
+ "description": "金额单位,如million;股数须与每股价值口径一致"
2394
+ },
2395
+ "base_revenue": {
2396
+ "type": "number",
2397
+ "description": "基期收入,正数"
2398
+ },
2399
+ "revenue_growth": {
2400
+ "type": "array",
2401
+ "items": {
2402
+ "type": "number"
2403
+ },
2404
+ "description": "逐年收入增长率小数,1..10年,如0.1"
2405
+ },
2406
+ "operating_margin": {
2407
+ "type": "array",
2408
+ "items": {
2409
+ "type": "number"
2410
+ },
2411
+ "description": "逐年营业利润率小数,长度同revenue_growth"
2412
+ },
2413
+ "tax_rate": {
2414
+ "type": "array",
2415
+ "items": {
2416
+ "type": "number"
2417
+ },
2418
+ "description": "逐年税率0..1,长度同revenue_growth"
2419
+ },
2420
+ "sales_to_capital": {
2421
+ "type": "number",
2422
+ "description": "销售资本比,正数;再投资=收入增量/该值"
2423
+ },
2424
+ "wacc": {
2425
+ "type": "array",
2426
+ "items": {
2427
+ "type": "number"
2428
+ },
2429
+ "description": "逐年WACC 0..1,长度同revenue_growth"
2430
+ },
2431
+ "terminal_growth": {
2432
+ "type": "number",
2433
+ "description": "永续增长率小数,须小于terminal_wacc且不大于terminal_roic"
2434
+ },
2435
+ "terminal_wacc": {
2436
+ "type": "number",
2437
+ "description": "永续期WACC 0..1"
2438
+ },
2439
+ "terminal_roic": {
2440
+ "type": "number",
2441
+ "description": "永续期ROIC,正数;终值再投资率=terminal_growth/terminal_roic"
2442
+ },
2443
+ "cash": {
2444
+ "type": "number",
2445
+ "description": "现金,默认0"
2446
+ },
2447
+ "debt": {
2448
+ "type": "number",
2449
+ "description": "有息债务,默认0"
2450
+ },
2451
+ "minority_interests": {
2452
+ "type": "number",
2453
+ "description": "少数股东权益,默认0"
2454
+ },
2455
+ "nonoperating_assets": {
2456
+ "type": "number",
2457
+ "description": "非经营资产,默认0"
2458
+ },
2459
+ "other_claims": {
2460
+ "type": "number",
2461
+ "description": "其他股权前索取权,默认0"
2462
+ },
2463
+ "diluted_shares": {
2464
+ "type": "number",
2465
+ "description": "稀释后股本,正数"
2466
+ },
2467
+ "current_price": {
2468
+ "type": "number",
2469
+ "description": "可选当前股价,用于计算upside_pct"
2470
+ }
2471
+ },
2472
+ "required": [
2473
+ "currency",
2474
+ "units",
2475
+ "base_revenue",
2476
+ "revenue_growth",
2477
+ "operating_margin",
2478
+ "tax_rate",
2479
+ "sales_to_capital",
2480
+ "wacc",
2481
+ "terminal_growth",
2482
+ "terminal_wacc",
2483
+ "terminal_roic",
2484
+ "diluted_shares"
2485
+ ],
2486
+ "additionalProperties": false
2487
+ }
2488
+ },
2489
+ {
2490
+ "name": "analyze_event_study",
2491
+ "description": "无状态事件研究:提供同市场股票及基准完整价格、事件日期;事件前一交易日收盘为基点,计算交易日窗口收益差。缺窗口/基准为null,标注重叠,不推断因果。",
2492
+ "parameters": {
2493
+ "type": "object",
2494
+ "properties": {
2495
+ "prices": {
2496
+ "type": "array",
2497
+ "items": {
2498
+ "type": "object",
2499
+ "properties": {
2500
+ "date": {
2501
+ "type": "string",
2502
+ "description": "YYYY-MM-DD,唯一日期"
2503
+ },
2504
+ "close": {
2505
+ "type": "number",
2506
+ "description": "正有限收盘价"
2507
+ }
2508
+ },
2509
+ "required": [
2510
+ "date",
2511
+ "close"
2512
+ ],
2513
+ "additionalProperties": false
2514
+ },
2515
+ "description": "完整日K收盘序列,2..20000条,不得跨股票或混用复权口径"
2516
+ },
2517
+ "benchmark_prices": {
2518
+ "type": "array",
2519
+ "items": {
2520
+ "type": "object",
2521
+ "properties": {
2522
+ "date": {
2523
+ "type": "string",
2524
+ "description": "YYYY-MM-DD,唯一日期"
2525
+ },
2526
+ "close": {
2527
+ "type": "number",
2528
+ "description": "正有限收盘价"
2529
+ }
2530
+ },
2531
+ "required": [
2532
+ "date",
2533
+ "close"
2534
+ ],
2535
+ "additionalProperties": false
2536
+ },
2537
+ "description": "完整日K收盘序列,2..20000条,不得跨股票或混用复权口径"
2538
+ },
2539
+ "event_dates": {
2540
+ "type": "array",
2541
+ "items": {
2542
+ "type": "string",
2543
+ "description": "YYYY-MM-DD,盘后公告传下一交易日"
2544
+ },
2545
+ "description": "1..100个唯一事件日"
2546
+ },
2547
+ "price_basis": {
2548
+ "type": "string",
2549
+ "description": "仅显式prices模式必需;代码模式报告实际提供方标记,缺失为unknown,须核实"
2550
+ },
2551
+ "horizons": {
2552
+ "type": "array",
2553
+ "items": {
2554
+ "type": "number",
2555
+ "description": "0=事件日,1=下一交易日;整数0..250"
2556
+ },
2557
+ "description": "1..20个窗口,默认0/1/5/10/20"
2558
+ },
2559
+ "start_date": {
2560
+ "type": "string",
2561
+ "description": "代码模式必需,YYYY-MM-DD,包含事件前基准日或训练窗口"
2562
+ },
2563
+ "end_date": {
2564
+ "type": "string",
2565
+ "description": "代码模式必需,YYYY-MM-DD,晚于start_date"
2566
+ },
2567
+ "symbol": {
2568
+ "type": "string",
2569
+ "description": "股票代码;与benchmark/start_date/end_date一起直接取数,和prices模式互斥"
2570
+ },
2571
+ "benchmark": {
2572
+ "type": "string",
2573
+ "description": "同市场基准代码;与symbol一起使用"
2574
+ }
2575
+ },
2576
+ "required": [
2577
+ "event_dates"
2578
+ ],
2579
+ "additionalProperties": false
2580
+ }
2581
+ },
2582
+ {
2583
+ "name": "validate_backtest",
2584
+ "description": "无状态回测稳健性:输入历史OHLCV和完整候选DSL;滚动训练选参数、后续不重叠窗口验证,列出全部样本内敏感性及跨标的结果。仅next_open,不自动优化或保存。",
2585
+ "parameters": {
2586
+ "type": "object",
2587
+ "properties": {
2588
+ "datasets": {
2589
+ "type": "array",
2590
+ "items": {
2591
+ "type": "object",
2592
+ "properties": {
2593
+ "symbol": {
2594
+ "type": "string",
2595
+ "description": "唯一股票代码"
2596
+ },
2597
+ "price_basis": {
2598
+ "type": "string",
2599
+ "description": "已核实复权/原始价格口径"
2600
+ },
2601
+ "bars": {
2602
+ "type": "array",
2603
+ "items": {
2604
+ "type": "object",
2605
+ "properties": {
2606
+ "date": {
2607
+ "type": "string",
2608
+ "description": "YYYY-MM-DD"
2609
+ },
2610
+ "open": {
2611
+ "type": "number",
2612
+ "description": "有限OHLCV;价格为正、volume非负"
2613
+ },
2614
+ "high": {
2615
+ "type": "number",
2616
+ "description": "有限OHLCV;价格为正、volume非负"
2617
+ },
2618
+ "low": {
2619
+ "type": "number",
2620
+ "description": "有限OHLCV;价格为正、volume非负"
2621
+ },
2622
+ "close": {
2623
+ "type": "number",
2624
+ "description": "有限OHLCV;价格为正、volume非负"
2625
+ },
2626
+ "volume": {
2627
+ "type": "number",
2628
+ "description": "有限OHLCV;价格为正、volume非负"
2629
+ }
2630
+ },
2631
+ "required": [
2632
+ "date",
2633
+ "open",
2634
+ "high",
2635
+ "low",
2636
+ "close",
2637
+ "volume"
2638
+ ],
2639
+ "additionalProperties": false
2640
+ },
2641
+ "description": "日期递增完整OHLCV,每组最多2000条,至少train_bars+test_bars"
2642
+ }
2643
+ },
2644
+ "required": [
2645
+ "symbol",
2646
+ "price_basis",
2647
+ "bars"
2648
+ ],
2649
+ "additionalProperties": false
2650
+ },
2651
+ "description": "1..5个标的,复用get_kline取数"
2652
+ },
2653
+ "strategies": {
2654
+ "type": "array",
2655
+ "items": {
2656
+ "type": "object",
2657
+ "properties": {
2658
+ "name": {
2659
+ "type": "string",
2660
+ "description": "唯一候选名"
2661
+ },
2662
+ "strategy": {
2663
+ "type": "object",
2664
+ "additionalProperties": true,
2665
+ "description": "完整既有YAML DSL对应JSON,允许parameters引用;仅next_open"
2666
+ }
2667
+ },
2668
+ "required": [
2669
+ "name",
2670
+ "strategy"
2671
+ ],
2672
+ "additionalProperties": false
2673
+ },
2674
+ "description": "1..5个预先确定的候选,禁止测试结果回调参数"
2675
+ },
2676
+ "train_bars": {
2677
+ "type": "number",
2678
+ "description": "训练交易日数30..1000,默认126"
2679
+ },
2680
+ "test_bars": {
2681
+ "type": "number",
2682
+ "description": "测试交易日数30..1000,默认63"
2683
+ },
2684
+ "capital": {
2685
+ "type": "number",
2686
+ "description": "每窗口初始资金,默认1000000"
2687
+ },
2688
+ "start_date": {
2689
+ "type": "string",
2690
+ "description": "代码模式必需,YYYY-MM-DD,包含事件前基准日或训练窗口"
2691
+ },
2692
+ "end_date": {
2693
+ "type": "string",
2694
+ "description": "代码模式必需,YYYY-MM-DD,晚于start_date"
2695
+ },
2696
+ "symbols": {
2697
+ "type": "array",
2698
+ "items": {
2699
+ "type": "string"
2700
+ },
2701
+ "description": "1..5个唯一股票代码,配合start_date/end_date直接取数;和datasets互斥"
2702
+ }
2703
+ },
2704
+ "required": [
2705
+ "strategies"
2706
+ ],
2707
+ "additionalProperties": false
2708
+ }
2709
+ },
2710
+ {
2711
+ "name": "compare_analysis_snapshots",
2712
+ "description": "无状态快照比较:传新旧JSON,返回JSON Pointer及新增/删除/变化/失效/恢复;不保存快照。数组整体比较,调用前按symbol对齐。",
2713
+ "parameters": {
2714
+ "type": "object",
2715
+ "properties": {
2716
+ "previous": {
2717
+ "type": "object",
2718
+ "additionalProperties": true,
2719
+ "description": "JSON对象,详见共享Skill与README"
2720
+ },
2721
+ "current": {
2722
+ "type": "object",
2723
+ "additionalProperties": true,
2724
+ "description": "JSON对象,详见共享Skill与README"
2725
+ }
2726
+ },
2727
+ "required": [
2728
+ "previous",
2729
+ "current"
2730
+ ],
2731
+ "additionalProperties": false
2732
+ }
2733
+ }
2734
+ ]