@weaxs/openclaw-stock-analysis 0.1.15 → 0.2.1
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 +1 -1
- package/dist/index.js +154 -20
- package/index.ts +165 -18
- package/openclaw.plugin.json +7 -0
- package/package.json +1 -1
- package/skills/dragon-head/SKILL.md +3 -1
- package/skills/emotion-cycle/SKILL.md +2 -0
- package/skills/hot-theme/SKILL.md +2 -1
- package/skills/stock-analysis/SKILL.md +9 -1
- package/tools/alert_rules.py +5 -18
- package/tools/backtest.py +4 -4
- package/tools/capabilities.py +8 -0
- package/tools/gather.py +12 -31
- package/tools/market_review.py +1 -1
- package/tools/name_resolver.py +4 -10
- package/tools/pattern.py +3 -24
- package/tools/report_renderer.py +1 -2
- package/tools/screener.py +5 -18
- package/tools/search_intel.py +1 -24
- package/tools/signal_tracker.py +275 -0
- package/tools/stock_data.py +580 -110
- package/tools/trading_calendar.py +110 -9
- package/tools/volume_analysis.py +3 -23
- package/tools/watchlist_context.py +1 -10
- package/scripts/sync-version.sh +0 -56
package/README.md
CHANGED
package/dist/index.js
CHANGED
|
@@ -4486,7 +4486,7 @@ var index_default = definePluginEntry({
|
|
|
4486
4486
|
});
|
|
4487
4487
|
api.registerTool({
|
|
4488
4488
|
name: "get_quote",
|
|
4489
|
-
description: "\u83B7\u53D6\u80A1\u7968\u5B9E\u65F6\u884C\u60C5\u62A5\u4EF7\uFF08\u73B0\u4EF7\u3001\u6DA8\u8DCC\u5E45\u3001\u91CF\u6BD4\u7B49\uFF09\u3002\u652F\u6301A\u80A1\u3001\u6E2F\u80A1\u3001\u7F8E\u80A1\u3001\u65E5\u80A1\u3001\u97E9\u80A1\u3001\u53F0\u80A1",
|
|
4489
|
+
description: "\u83B7\u53D6\u80A1\u7968\u5B9E\u65F6\u884C\u60C5\u62A5\u4EF7\uFF08\u73B0\u4EF7\u3001\u6DA8\u8DCC\u5E45\u3001\u91CF\u6BD4\u7B49\uFF09\u3002\u652F\u6301A\u80A1\u3001\u6E2F\u80A1\u3001\u7F8E\u80A1\u3001\u65E5\u80A1\u3001\u97E9\u80A1\u3001\u53F0\u80A1\uFF1B\u975E\u4EA4\u6613\u65F6\u6BB5\u8FD4\u56DE\u6700\u8FD1\u4EA4\u6613\u65E5\u6536\u76D8\u4EF7\u5E76\u4EE5 as_of/stale \u6807\u6CE8",
|
|
4490
4490
|
parameters: typebox_exports.Object({
|
|
4491
4491
|
symbol: typebox_exports.String({ description: "\u80A1\u7968\u4EE3\u7801\uFF08A\u80A1\u5982600519\uFF0C\u7F8E\u80A1\u5982AAPL\uFF0C\u6E2F\u80A1\u598200700.HK\uFF09" })
|
|
4492
4492
|
}),
|
|
@@ -4627,7 +4627,7 @@ var index_default = definePluginEntry({
|
|
|
4627
4627
|
});
|
|
4628
4628
|
api.registerTool({
|
|
4629
4629
|
name: "get_sector_rankings",
|
|
4630
|
-
description: "\u83B7\u53D6A\u80A1\
|
|
4630
|
+
description: "\u83B7\u53D6A\u80A1\u677F\u5757\u6DA8\u8DCC\u5E45\u6392\u884C\uFF08\u542B\u9886\u6DA8\u80A1\u3001\u6DA8\u8DCC\u5BB6\u6570\u7B49\uFF09\u3002board_type=industry\uFF08\u9ED8\u8BA4\uFF09\u4E3A\u884C\u4E1A\u677F\u5757\uFF0Cboard_type=concept \u65F6\u4E3A\u6982\u5FF5\u677F\u5757\u6392\u884C\u3002\u652F\u6301\u67E5\u770B\u6DA8\u5E45\u699C/\u8DCC\u5E45\u699C/\u53CC\u5411",
|
|
4631
4631
|
parameters: typebox_exports.Object({
|
|
4632
4632
|
top: typebox_exports.Optional(
|
|
4633
4633
|
typebox_exports.Number({ description: "\u8FD4\u56DE\u6392\u540D\u524DN\u7684\u677F\u5757\uFF0C\u9ED8\u8BA4 10" })
|
|
@@ -4637,6 +4637,12 @@ var index_default = definePluginEntry({
|
|
|
4637
4637
|
[typebox_exports.Literal("top"), typebox_exports.Literal("bottom"), typebox_exports.Literal("both")],
|
|
4638
4638
|
{ description: "top=\u6DA8\u5E45\u699C\uFF08\u9ED8\u8BA4\uFF09\uFF0Cbottom=\u8DCC\u5E45\u699C\uFF0Cboth=\u53CC\u5411" }
|
|
4639
4639
|
)
|
|
4640
|
+
),
|
|
4641
|
+
board_type: typebox_exports.Optional(
|
|
4642
|
+
typebox_exports.Union(
|
|
4643
|
+
[typebox_exports.Literal("industry"), typebox_exports.Literal("concept")],
|
|
4644
|
+
{ description: "\u677F\u5757\u7C7B\u578B\uFF1Aindustry=\u884C\u4E1A\uFF08\u9ED8\u8BA4\uFF09\uFF0Cconcept=\u6982\u5FF5" }
|
|
4645
|
+
)
|
|
4640
4646
|
)
|
|
4641
4647
|
}),
|
|
4642
4648
|
async execute(_id, params) {
|
|
@@ -4645,7 +4651,9 @@ var index_default = definePluginEntry({
|
|
|
4645
4651
|
"--top",
|
|
4646
4652
|
String(params.top ?? 10),
|
|
4647
4653
|
"--direction",
|
|
4648
|
-
params.direction ?? "top"
|
|
4654
|
+
params.direction ?? "top",
|
|
4655
|
+
"--board-type",
|
|
4656
|
+
params.board_type ?? "industry"
|
|
4649
4657
|
]);
|
|
4650
4658
|
return asText(out);
|
|
4651
4659
|
}
|
|
@@ -4714,16 +4722,63 @@ var index_default = definePluginEntry({
|
|
|
4714
4722
|
api.registerTool({
|
|
4715
4723
|
name: "get_market_stats",
|
|
4716
4724
|
description: "\u83B7\u53D6A\u80A1\u5E02\u573A\u6574\u4F53\u7EDF\u8BA1\uFF08\u6DA8\u8DCC\u5BB6\u6570\u3001\u6DA8\u505C\u8DCC\u505C\u6570\u3001\u5E73\u5747\u6DA8\u5E45\u3001\u6DA8\u8DCCTop5\u3001\u603B\u6210\u4EA4\u989D\uFF09\u3002\u7528\u4E8E\u8861\u91CF\u5E02\u573A\u6574\u4F53\u60C5\u7EEA\u4E0E\u6E29\u5EA6",
|
|
4725
|
+
parameters: typebox_exports.Object({}),
|
|
4726
|
+
async execute() {
|
|
4727
|
+
const out = await runPy("stock_data.py", ["market_stats"]);
|
|
4728
|
+
return asText(out);
|
|
4729
|
+
}
|
|
4730
|
+
});
|
|
4731
|
+
api.registerTool({
|
|
4732
|
+
name: "get_limit_up_pool",
|
|
4733
|
+
description: "\u83B7\u53D6A\u80A1\u6DA8\u505C\u6C60/\u6DA8\u505C\u677F\u590D\u76D8\u2014\u2014\u5F53\u65E5\u6DA8\u505C\u4E2A\u80A1\uFF0C\u542B\u8FDE\u677F\u6570\u3001\u5C01\u677F\u8D44\u91D1\u3001\u70B8\u677F\u6B21\u6570\u3001\u9996\u672B\u6B21\u5C01\u677F\u65F6\u95F4\u3001\u6240\u5C5E\u884C\u4E1A\u3002\u77ED\u7EBF\u60C5\u7EEA\u4E0E\u9F99\u5934\u6218\u6CD5\u6838\u5FC3\u6570\u636E",
|
|
4717
4734
|
parameters: typebox_exports.Object({
|
|
4718
|
-
|
|
4719
|
-
typebox_exports.
|
|
4735
|
+
date: typebox_exports.Optional(
|
|
4736
|
+
typebox_exports.String({ description: "\u65E5\u671F\uFF08YYYYMMDD\uFF09\uFF0C\u9ED8\u8BA4\u5F53\u65E5\uFF1B\u975E\u4EA4\u6613\u65E5\u6216\u672A\u6765\u65E5\u671F\u81EA\u52A8\u56DE\u9000\u5230\u6700\u8FD1\u4EA4\u6613\u65E5\uFF08\u8FD4\u56DE\u542B requested_date \u4E0E stale \u6807\u6CE8\uFF09" })
|
|
4737
|
+
)
|
|
4738
|
+
}),
|
|
4739
|
+
async execute(_id, params) {
|
|
4740
|
+
const args = ["limit_up_pool"];
|
|
4741
|
+
if (params.date) args.push("--date", params.date);
|
|
4742
|
+
const out = await runPy("stock_data.py", args);
|
|
4743
|
+
return asText(out);
|
|
4744
|
+
}
|
|
4745
|
+
});
|
|
4746
|
+
api.registerTool({
|
|
4747
|
+
name: "get_dragon_tiger",
|
|
4748
|
+
description: "\u83B7\u53D6A\u80A1\u9F99\u864E\u699C\u2014\u2014\u4E0A\u699C\u4E2A\u80A1\u51C0\u4E70\u989D/\u4E70\u5165\u989D/\u5356\u51FA\u989D/\u4E0A\u699C\u539F\u56E0/\u89E3\u8BFB\uFF0C\u53EF\u6309\u4E2A\u80A1\u8FC7\u6EE4",
|
|
4749
|
+
parameters: typebox_exports.Object({
|
|
4750
|
+
date: typebox_exports.Optional(
|
|
4751
|
+
typebox_exports.String({ description: "\u65E5\u671F\uFF08YYYY-MM-DD\uFF09\uFF0C\u9ED8\u8BA4\u5F53\u65E5\uFF1B\u975E\u4EA4\u6613\u65E5\u6216\u672A\u6765\u65E5\u671F\u81EA\u52A8\u56DE\u9000\u5230\u6700\u8FD1\u4EA4\u6613\u65E5\uFF08\u8FD4\u56DE\u542B requested_date \u4E0E stale \u6807\u6CE8\uFF09" })
|
|
4752
|
+
),
|
|
4753
|
+
symbol: typebox_exports.Optional(
|
|
4754
|
+
typebox_exports.String({ description: "A\u80A1\u80A1\u7968\u4EE3\u7801\uFF08\u53EF\u9009\uFF0C\u6309\u4E2A\u80A1\u8FC7\u6EE4\uFF09\uFF0C\u5982 600519" })
|
|
4755
|
+
),
|
|
4756
|
+
top: typebox_exports.Optional(
|
|
4757
|
+
typebox_exports.Number({ description: "\u8FD4\u56DE\u524DN\u6761\uFF0C\u9ED8\u8BA4 20" })
|
|
4758
|
+
)
|
|
4759
|
+
}),
|
|
4760
|
+
async execute(_id, params) {
|
|
4761
|
+
const args = ["dragon_tiger"];
|
|
4762
|
+
if (params.date) args.push("--date", params.date);
|
|
4763
|
+
if (params.symbol) args.push("--symbol", params.symbol);
|
|
4764
|
+
args.push("--top", String(params.top ?? 20));
|
|
4765
|
+
const out = await runPy("stock_data.py", args);
|
|
4766
|
+
return asText(out);
|
|
4767
|
+
}
|
|
4768
|
+
});
|
|
4769
|
+
api.registerTool({
|
|
4770
|
+
name: "get_hot_stocks",
|
|
4771
|
+
description: "\u83B7\u53D6A\u80A1\u5168\u5E02\u573A\u4EBA\u6C14\u70ED\u641C\u699C\uFF08\u4E1C\u65B9\u8D22\u5BCC\u4EBA\u6C14\u699C\uFF09",
|
|
4772
|
+
parameters: typebox_exports.Object({
|
|
4773
|
+
top: typebox_exports.Optional(
|
|
4774
|
+
typebox_exports.Number({ description: "\u8FD4\u56DE\u524DN\u53EA\uFF0C\u9ED8\u8BA4 20" })
|
|
4720
4775
|
)
|
|
4721
4776
|
}),
|
|
4722
4777
|
async execute(_id, params) {
|
|
4723
4778
|
const out = await runPy("stock_data.py", [
|
|
4724
|
-
"
|
|
4725
|
-
"--
|
|
4726
|
-
params.
|
|
4779
|
+
"hot_stocks",
|
|
4780
|
+
"--top",
|
|
4781
|
+
String(params.top ?? 20)
|
|
4727
4782
|
]);
|
|
4728
4783
|
return asText(out);
|
|
4729
4784
|
}
|
|
@@ -4912,6 +4967,20 @@ var index_default = definePluginEntry({
|
|
|
4912
4967
|
return asText(out);
|
|
4913
4968
|
}
|
|
4914
4969
|
});
|
|
4970
|
+
api.registerTool({
|
|
4971
|
+
name: "get_trading_phase",
|
|
4972
|
+
description: "\u67E5\u8BE2\u67D0\u5E02\u573A\u5F53\u524D\u4EA4\u6613\u65F6\u6BB5\uFF08\u76D8\u524D/\u65E9\u76D8/\u5348\u95F4\u4F11\u5E02/\u5348\u76D8/\u4EA4\u6613\u4E2D/\u76D8\u540E/\u4F11\u5E02\uFF09\uFF0C\u7528\u4E8E\u6B63\u786E\u89E3\u8BFB\u5B9E\u65F6\u884C\u60C5\u7684\u76D8\u4E2D\u8BED\u4E49\u3002\u652F\u6301CN/HK/US/JP/KR/TW",
|
|
4973
|
+
parameters: typebox_exports.Object({
|
|
4974
|
+
market: typebox_exports.Union(
|
|
4975
|
+
[typebox_exports.Literal("CN"), typebox_exports.Literal("HK"), typebox_exports.Literal("US"), typebox_exports.Literal("JP"), typebox_exports.Literal("KR"), typebox_exports.Literal("TW")],
|
|
4976
|
+
{ description: "\u5E02\u573A" }
|
|
4977
|
+
)
|
|
4978
|
+
}),
|
|
4979
|
+
async execute(_id, params) {
|
|
4980
|
+
const out = await runPy("trading_calendar.py", ["phase", params.market]);
|
|
4981
|
+
return asText(out);
|
|
4982
|
+
}
|
|
4983
|
+
});
|
|
4915
4984
|
api.registerTool({
|
|
4916
4985
|
name: "calculate_ma",
|
|
4917
4986
|
description: "\u72EC\u7ACB\u5747\u7EBF\u8BA1\u7B97\u5668 \u2014 \u652F\u6301\u4EFB\u610F\u5468\u671FMA\uFF085/10/20/30/60/120/250\u6216\u81EA\u5B9A\u4E49\uFF09+ \u504F\u79BB\u5EA6 + \u5747\u7EBF\u6392\u5217 + \u91D1\u53C9\u6B7B\u53C9\u68C0\u6D4B\u3002\u53EA\u8981\u5747\u7EBF\u6570\u503C\u6216\u9700\u898130/120/250\u7B49\u975E\u9ED8\u8BA4\u5468\u671F\u65F6\u7528\u672C\u5DE5\u5177\uFF1B\u7EFC\u5408\u6280\u672F\u9762\u5206\u6790\u7528 get_technical_analysis",
|
|
@@ -5018,7 +5087,7 @@ var index_default = definePluginEntry({
|
|
|
5018
5087
|
});
|
|
5019
5088
|
api.registerTool({
|
|
5020
5089
|
name: "get_trending_sentiment",
|
|
5021
|
-
description: "\u83B7\u53D6\u793E\u4EA4\u5A92\u4F53\u70ED\u95E8\u8D8B\u52BF\uFF08Reddit/X/Polymarket\u70ED\u95E8\u80A1\u7968\u8BA8\u8BBA\uFF09\u3002\
|
|
5090
|
+
description: "\u83B7\u53D6\u793E\u4EA4\u5A92\u4F53\u70ED\u95E8\u8D8B\u52BF\uFF08Reddit/X/Polymarket\u70ED\u95E8\u80A1\u7968\u8BA8\u8BBA\uFF09\u3002\u9002\u7528\u4E8E\u53D1\u73B0\u5E02\u573A\u70ED\u70B9\uFF1B\u67E5\u4E2A\u80A1\u60C5\u7EEA\u7528 get_social_sentiment",
|
|
5022
5091
|
parameters: typebox_exports.Object({}),
|
|
5023
5092
|
async execute() {
|
|
5024
5093
|
const out = await runPy("search_intel.py", ["trending"]);
|
|
@@ -5207,20 +5276,11 @@ var index_default = definePluginEntry({
|
|
|
5207
5276
|
name: "render_market_report",
|
|
5208
5277
|
description: "\u5927\u76D8\u590D\u76D8\u62A5\u544A\u6E32\u67D3 \u2014 \u5C06\u7ED3\u6784\u5316\u62A5\u544A JSON \u901A\u8FC7 j2 \u6A21\u677F\u6E32\u67D3\u4E3A Markdown\u3002report \u5B57\u6BB5\u4EE5 schemas/market_review_schema.json \u4E3A\u51C6\u3002\u4EC5\u6E32\u67D3\uFF0C\u4E0D\u4FDD\u5B58\u4E0D\u63A8\u9001",
|
|
5209
5278
|
parameters: typebox_exports.Object({
|
|
5210
|
-
report: typebox_exports.Object({}, { additionalProperties: true, description: "\u7ED3\u6784\u5316\u5E02\u573A\u590D\u76D8" })
|
|
5211
|
-
template: typebox_exports.Optional(
|
|
5212
|
-
typebox_exports.Union([typebox_exports.Literal("full")], { description: "\u6A21\u677F\u7C7B\u578B\uFF0C\u9ED8\u8BA4 full" })
|
|
5213
|
-
)
|
|
5279
|
+
report: typebox_exports.Object({}, { additionalProperties: true, description: "\u7ED3\u6784\u5316\u5E02\u573A\u590D\u76D8" })
|
|
5214
5280
|
}),
|
|
5215
5281
|
async execute(_id, params) {
|
|
5216
5282
|
const b64 = Buffer.from(JSON.stringify(params.report), "utf-8").toString("base64");
|
|
5217
|
-
const out = await runPy("report_renderer.py", [
|
|
5218
|
-
"market",
|
|
5219
|
-
"--template",
|
|
5220
|
-
params.template ?? "full",
|
|
5221
|
-
"--input-b64",
|
|
5222
|
-
b64
|
|
5223
|
-
]);
|
|
5283
|
+
const out = await runPy("report_renderer.py", ["market", "--input-b64", b64]);
|
|
5224
5284
|
return asText(out);
|
|
5225
5285
|
}
|
|
5226
5286
|
});
|
|
@@ -5296,6 +5356,80 @@ var index_default = definePluginEntry({
|
|
|
5296
5356
|
return asText(out);
|
|
5297
5357
|
}
|
|
5298
5358
|
});
|
|
5359
|
+
api.registerTool({
|
|
5360
|
+
name: "record_signal",
|
|
5361
|
+
description: "\u8BB0\u5F55\u4E00\u6761 AI \u5206\u6790\u5EFA\u8BAE\u4FE1\u53F7\uFF08\u65B9\u5411/\u5165\u573A\u4EF7/\u76EE\u6807\u4EF7/\u6B62\u635F\u4EF7/\u6301\u6709\u671F\u9650\uFF09\uFF0C\u4F9B\u540E\u7EED\u80DC\u7387\u8BC4\u4F30\u3002\u4FE1\u53F7\u6301\u4E45\u5316\u5728\u672C\u5730 JSONL\uFF08$STOCK_SIGNAL_STORE \u6216 ~/.stock-analysis/signals.jsonl\uFF09\uFF0C\u5BBF\u4E3B Agent \u81EA\u884C\u51B3\u5B9A\u4F55\u65F6 record/evaluate",
|
|
5362
|
+
parameters: typebox_exports.Object({
|
|
5363
|
+
symbol: typebox_exports.String({ description: "\u80A1\u7968\u4EE3\u7801\uFF08A\u80A1\u5982600519\uFF0C\u7F8E\u80A1\u5982AAPL\uFF0C\u6E2F\u80A1\u598200700.HK\uFF09" }),
|
|
5364
|
+
direction: typebox_exports.Union([typebox_exports.Literal("buy"), typebox_exports.Literal("sell")], {
|
|
5365
|
+
description: "\u5EFA\u8BAE\u65B9\u5411"
|
|
5366
|
+
}),
|
|
5367
|
+
entry_price: typebox_exports.Optional(typebox_exports.Number({ description: "\u5165\u573A\u4EF7\uFF08\u53EF\u9009\uFF09" })),
|
|
5368
|
+
target_price: typebox_exports.Optional(typebox_exports.Number({ description: "\u76EE\u6807\u4EF7\uFF08\u53EF\u9009\uFF09" })),
|
|
5369
|
+
stop_price: typebox_exports.Optional(typebox_exports.Number({ description: "\u6B62\u635F\u4EF7\uFF08\u53EF\u9009\uFF09" })),
|
|
5370
|
+
horizon_days: typebox_exports.Optional(
|
|
5371
|
+
typebox_exports.Number({ description: "\u6301\u6709\u671F\u9650\uFF08\u4EA4\u6613\u65E5\uFF09\uFF0C\u9ED8\u8BA4 10" })
|
|
5372
|
+
),
|
|
5373
|
+
source: typebox_exports.Optional(
|
|
5374
|
+
typebox_exports.String({ description: "\u4FE1\u53F7\u6765\u6E90\uFF08\u5982\u89E6\u53D1\u8BE5\u5EFA\u8BAE\u7684 skill \u540D\uFF09" })
|
|
5375
|
+
),
|
|
5376
|
+
note: typebox_exports.Optional(typebox_exports.String({ description: "\u5907\u6CE8\uFF08\u53EF\u9009\uFF09" }))
|
|
5377
|
+
}),
|
|
5378
|
+
async execute(_id, params) {
|
|
5379
|
+
const args = [
|
|
5380
|
+
"record",
|
|
5381
|
+
params.symbol,
|
|
5382
|
+
"--direction",
|
|
5383
|
+
params.direction,
|
|
5384
|
+
"--horizon-days",
|
|
5385
|
+
String(params.horizon_days ?? 10)
|
|
5386
|
+
];
|
|
5387
|
+
if (params.entry_price !== void 0) args.push("--entry-price", String(params.entry_price));
|
|
5388
|
+
if (params.target_price !== void 0) args.push("--target-price", String(params.target_price));
|
|
5389
|
+
if (params.stop_price !== void 0) args.push("--stop-price", String(params.stop_price));
|
|
5390
|
+
if (params.source) args.push("--source", params.source);
|
|
5391
|
+
if (params.note) args.push("--note", params.note);
|
|
5392
|
+
const out = await runPy("signal_tracker.py", args);
|
|
5393
|
+
return asText(out);
|
|
5394
|
+
}
|
|
5395
|
+
});
|
|
5396
|
+
api.registerTool({
|
|
5397
|
+
name: "evaluate_signals",
|
|
5398
|
+
description: "\u8BC4\u4F30\u5230\u671F\u4FE1\u53F7\uFF1A\u62C9\u53D6\u8BB0\u5F55\u65E5\u4E4B\u540E\u7684\u65E5K\uFF0C\u5224\u5B9A target_hit/stop_hit/timeout \u5E76\u8BA1\u7B97\u6536\u76CA\uFF0C\u56DE\u5199\u5B58\u50A8\u3002\u8BB0\u5F55\u5EFA\u8BAE\u7528 record_signal\uFF0C\u80DC\u7387\u590D\u76D8\u7528 get_signal_summary",
|
|
5399
|
+
parameters: typebox_exports.Object({
|
|
5400
|
+
symbol: typebox_exports.Optional(
|
|
5401
|
+
typebox_exports.String({ description: "\u80A1\u7968\u4EE3\u7801\uFF08\u53EF\u9009\uFF0C\u53EA\u8BC4\u4F30\u8BE5\u80A1\u7684\u4FE1\u53F7\uFF09" })
|
|
5402
|
+
)
|
|
5403
|
+
}),
|
|
5404
|
+
async execute(_id, params) {
|
|
5405
|
+
const args = ["evaluate"];
|
|
5406
|
+
if (params.symbol) args.push("--symbol", params.symbol);
|
|
5407
|
+
const out = await runPy("signal_tracker.py", args);
|
|
5408
|
+
return asText(out);
|
|
5409
|
+
}
|
|
5410
|
+
});
|
|
5411
|
+
api.registerTool({
|
|
5412
|
+
name: "get_signal_summary",
|
|
5413
|
+
description: "\u4FE1\u53F7\u80DC\u7387\u6C47\u603B\uFF08\u53EF\u6309 source/symbol/status \u8FC7\u6EE4\uFF09\uFF1A\u80DC\u7387\u3001\u5E73\u5747\u6536\u76CA\u3001\u7ED3\u679C\u5206\u5E03\u4E0E\u660E\u7EC6",
|
|
5414
|
+
parameters: typebox_exports.Object({
|
|
5415
|
+
source: typebox_exports.Optional(typebox_exports.String({ description: "\u6309\u4FE1\u53F7\u6765\u6E90\u8FC7\u6EE4\uFF08\u53EF\u9009\uFF09" })),
|
|
5416
|
+
symbol: typebox_exports.Optional(typebox_exports.String({ description: "\u6309\u80A1\u7968\u4EE3\u7801\u8FC7\u6EE4\uFF08\u53EF\u9009\uFF09" })),
|
|
5417
|
+
status: typebox_exports.Optional(
|
|
5418
|
+
typebox_exports.Union(
|
|
5419
|
+
[typebox_exports.Literal("open"), typebox_exports.Literal("closed"), typebox_exports.Literal("all")],
|
|
5420
|
+
{ description: "open=\u672A\u7ED3\u7B97\uFF0Cclosed=\u5DF2\u7ED3\u7B97\uFF0Call=\u5168\u90E8\uFF08\u9ED8\u8BA4\uFF09" }
|
|
5421
|
+
)
|
|
5422
|
+
)
|
|
5423
|
+
}),
|
|
5424
|
+
async execute(_id, params) {
|
|
5425
|
+
const args = ["summary"];
|
|
5426
|
+
if (params.source) args.push("--source", params.source);
|
|
5427
|
+
if (params.symbol) args.push("--symbol", params.symbol);
|
|
5428
|
+
args.push("--status", params.status ?? "all");
|
|
5429
|
+
const out = await runPy("signal_tracker.py", args);
|
|
5430
|
+
return asText(out);
|
|
5431
|
+
}
|
|
5432
|
+
});
|
|
5299
5433
|
api.registerTool({
|
|
5300
5434
|
name: "parse_stock_list",
|
|
5301
5435
|
description: "\u81EA\u9009\u80A1/\u6587\u672C\u5BFC\u5165\u89E3\u6790 \u2014 \u4ECE\u81EA\u7136\u8BED\u8A00\u3001CSV\u3001Markdown \u8868\u683C\u63D0\u53D6\u80A1\u7968\uFF0C\u81EA\u52A8\u8BC6\u522B A \u80A1 6 \u4F4D\u4EE3\u7801\u3001\u6E2F\u80A1 xxxxx.HK\u3001\u7F8E\u80A1 ticker\u3001\u65E5\u80A1 xxxx.T\u3001\u97E9\u80A1 xxxxxx.KS/KQ\u3001\u53F0\u80A1 xxxx.TW\uFF0C\u5E76\u8C03\u7528 name_resolver \u5904\u7406\u4E2D\u6587\u80A1\u7968\u540D",
|
package/index.ts
CHANGED
|
@@ -88,7 +88,7 @@ export default definePluginEntry({
|
|
|
88
88
|
|
|
89
89
|
api.registerTool({
|
|
90
90
|
name: "get_quote",
|
|
91
|
-
description: "获取股票实时行情报价(现价、涨跌幅、量比等)。支持A
|
|
91
|
+
description: "获取股票实时行情报价(现价、涨跌幅、量比等)。支持A股、港股、美股、日股、韩股、台股;非交易时段返回最近交易日收盘价并以 as_of/stale 标注",
|
|
92
92
|
parameters: Type.Object({
|
|
93
93
|
symbol: Type.String({ description: "股票代码(A股如600519,美股如AAPL,港股如00700.HK)" }),
|
|
94
94
|
}),
|
|
@@ -245,7 +245,7 @@ export default definePluginEntry({
|
|
|
245
245
|
api.registerTool({
|
|
246
246
|
name: "get_sector_rankings",
|
|
247
247
|
description:
|
|
248
|
-
"获取A
|
|
248
|
+
"获取A股板块涨跌幅排行(含领涨股、涨跌家数等)。board_type=industry(默认)为行业板块,board_type=concept 时为概念板块排行。支持查看涨幅榜/跌幅榜/双向",
|
|
249
249
|
parameters: Type.Object({
|
|
250
250
|
top: Type.Optional(
|
|
251
251
|
Type.Number({ description: "返回排名前N的板块,默认 10" })
|
|
@@ -256,6 +256,12 @@ export default definePluginEntry({
|
|
|
256
256
|
{ description: "top=涨幅榜(默认),bottom=跌幅榜,both=双向" }
|
|
257
257
|
)
|
|
258
258
|
),
|
|
259
|
+
board_type: Type.Optional(
|
|
260
|
+
Type.Union(
|
|
261
|
+
[Type.Literal("industry"), Type.Literal("concept")],
|
|
262
|
+
{ description: "板块类型:industry=行业(默认),concept=概念" }
|
|
263
|
+
)
|
|
264
|
+
),
|
|
259
265
|
}),
|
|
260
266
|
async execute(_id, params) {
|
|
261
267
|
const out = await runPy("stock_data.py", [
|
|
@@ -264,6 +270,8 @@ export default definePluginEntry({
|
|
|
264
270
|
String(params.top ?? 10),
|
|
265
271
|
"--direction",
|
|
266
272
|
params.direction ?? "top",
|
|
273
|
+
"--board-type",
|
|
274
|
+
params.board_type ?? "industry",
|
|
267
275
|
]);
|
|
268
276
|
return asText(out);
|
|
269
277
|
},
|
|
@@ -342,16 +350,68 @@ export default definePluginEntry({
|
|
|
342
350
|
name: "get_market_stats",
|
|
343
351
|
description:
|
|
344
352
|
"获取A股市场整体统计(涨跌家数、涨停跌停数、平均涨幅、涨跌Top5、总成交额)。用于衡量市场整体情绪与温度",
|
|
353
|
+
parameters: Type.Object({}),
|
|
354
|
+
async execute() {
|
|
355
|
+
const out = await runPy("stock_data.py", ["market_stats"]);
|
|
356
|
+
return asText(out);
|
|
357
|
+
},
|
|
358
|
+
});
|
|
359
|
+
|
|
360
|
+
api.registerTool({
|
|
361
|
+
name: "get_limit_up_pool",
|
|
362
|
+
description:
|
|
363
|
+
"获取A股涨停池/涨停板复盘——当日涨停个股,含连板数、封板资金、炸板次数、首末次封板时间、所属行业。短线情绪与龙头战法核心数据",
|
|
345
364
|
parameters: Type.Object({
|
|
346
|
-
|
|
347
|
-
Type.
|
|
365
|
+
date: Type.Optional(
|
|
366
|
+
Type.String({ description: "日期(YYYYMMDD),默认当日;非交易日或未来日期自动回退到最近交易日(返回含 requested_date 与 stale 标注)" })
|
|
367
|
+
),
|
|
368
|
+
}),
|
|
369
|
+
async execute(_id, params) {
|
|
370
|
+
const args = ["limit_up_pool"];
|
|
371
|
+
if (params.date) args.push("--date", params.date);
|
|
372
|
+
const out = await runPy("stock_data.py", args);
|
|
373
|
+
return asText(out);
|
|
374
|
+
},
|
|
375
|
+
});
|
|
376
|
+
|
|
377
|
+
api.registerTool({
|
|
378
|
+
name: "get_dragon_tiger",
|
|
379
|
+
description:
|
|
380
|
+
"获取A股龙虎榜——上榜个股净买额/买入额/卖出额/上榜原因/解读,可按个股过滤",
|
|
381
|
+
parameters: Type.Object({
|
|
382
|
+
date: Type.Optional(
|
|
383
|
+
Type.String({ description: "日期(YYYY-MM-DD),默认当日;非交易日或未来日期自动回退到最近交易日(返回含 requested_date 与 stale 标注)" })
|
|
384
|
+
),
|
|
385
|
+
symbol: Type.Optional(
|
|
386
|
+
Type.String({ description: "A股股票代码(可选,按个股过滤),如 600519" })
|
|
387
|
+
),
|
|
388
|
+
top: Type.Optional(
|
|
389
|
+
Type.Number({ description: "返回前N条,默认 20" })
|
|
390
|
+
),
|
|
391
|
+
}),
|
|
392
|
+
async execute(_id, params) {
|
|
393
|
+
const args = ["dragon_tiger"];
|
|
394
|
+
if (params.date) args.push("--date", params.date);
|
|
395
|
+
if (params.symbol) args.push("--symbol", params.symbol);
|
|
396
|
+
args.push("--top", String(params.top ?? 20));
|
|
397
|
+
const out = await runPy("stock_data.py", args);
|
|
398
|
+
return asText(out);
|
|
399
|
+
},
|
|
400
|
+
});
|
|
401
|
+
|
|
402
|
+
api.registerTool({
|
|
403
|
+
name: "get_hot_stocks",
|
|
404
|
+
description: "获取A股全市场人气热搜榜(东方财富人气榜)",
|
|
405
|
+
parameters: Type.Object({
|
|
406
|
+
top: Type.Optional(
|
|
407
|
+
Type.Number({ description: "返回前N只,默认 20" })
|
|
348
408
|
),
|
|
349
409
|
}),
|
|
350
410
|
async execute(_id, params) {
|
|
351
411
|
const out = await runPy("stock_data.py", [
|
|
352
|
-
"
|
|
353
|
-
"--
|
|
354
|
-
params.
|
|
412
|
+
"hot_stocks",
|
|
413
|
+
"--top",
|
|
414
|
+
String(params.top ?? 20),
|
|
355
415
|
]);
|
|
356
416
|
return asText(out);
|
|
357
417
|
},
|
|
@@ -560,6 +620,22 @@ export default definePluginEntry({
|
|
|
560
620
|
},
|
|
561
621
|
});
|
|
562
622
|
|
|
623
|
+
api.registerTool({
|
|
624
|
+
name: "get_trading_phase",
|
|
625
|
+
description:
|
|
626
|
+
"查询某市场当前交易时段(盘前/早盘/午间休市/午盘/交易中/盘后/休市),用于正确解读实时行情的盘中语义。支持CN/HK/US/JP/KR/TW",
|
|
627
|
+
parameters: Type.Object({
|
|
628
|
+
market: Type.Union(
|
|
629
|
+
[Type.Literal("CN"), Type.Literal("HK"), Type.Literal("US"), Type.Literal("JP"), Type.Literal("KR"), Type.Literal("TW")],
|
|
630
|
+
{ description: "市场" }
|
|
631
|
+
),
|
|
632
|
+
}),
|
|
633
|
+
async execute(_id, params) {
|
|
634
|
+
const out = await runPy("trading_calendar.py", ["phase", params.market]);
|
|
635
|
+
return asText(out);
|
|
636
|
+
},
|
|
637
|
+
});
|
|
638
|
+
|
|
563
639
|
// --- Standalone MA Calculator ---
|
|
564
640
|
|
|
565
641
|
api.registerTool({
|
|
@@ -683,7 +759,7 @@ export default definePluginEntry({
|
|
|
683
759
|
api.registerTool({
|
|
684
760
|
name: "get_trending_sentiment",
|
|
685
761
|
description:
|
|
686
|
-
"获取社交媒体热门趋势(Reddit/X/Polymarket
|
|
762
|
+
"获取社交媒体热门趋势(Reddit/X/Polymarket热门股票讨论)。适用于发现市场热点;查个股情绪用 get_social_sentiment",
|
|
687
763
|
parameters: Type.Object({}),
|
|
688
764
|
async execute() {
|
|
689
765
|
const out = await runPy("search_intel.py", ["trending"]);
|
|
@@ -899,19 +975,10 @@ export default definePluginEntry({
|
|
|
899
975
|
"大盘复盘报告渲染 — 将结构化报告 JSON 通过 j2 模板渲染为 Markdown。report 字段以 schemas/market_review_schema.json 为准。仅渲染,不保存不推送",
|
|
900
976
|
parameters: Type.Object({
|
|
901
977
|
report: Type.Object({}, { additionalProperties: true, description: "结构化市场复盘" }),
|
|
902
|
-
template: Type.Optional(
|
|
903
|
-
Type.Union([Type.Literal("full")], { description: "模板类型,默认 full" })
|
|
904
|
-
),
|
|
905
978
|
}),
|
|
906
979
|
async execute(_id, params) {
|
|
907
980
|
const b64 = Buffer.from(JSON.stringify(params.report), "utf-8").toString("base64");
|
|
908
|
-
const out = await runPy("report_renderer.py", [
|
|
909
|
-
"market",
|
|
910
|
-
"--template",
|
|
911
|
-
params.template ?? "full",
|
|
912
|
-
"--input-b64",
|
|
913
|
-
b64,
|
|
914
|
-
]);
|
|
981
|
+
const out = await runPy("report_renderer.py", ["market", "--input-b64", b64]);
|
|
915
982
|
return asText(out);
|
|
916
983
|
},
|
|
917
984
|
});
|
|
@@ -996,6 +1063,86 @@ export default definePluginEntry({
|
|
|
996
1063
|
},
|
|
997
1064
|
});
|
|
998
1065
|
|
|
1066
|
+
api.registerTool({
|
|
1067
|
+
name: "record_signal",
|
|
1068
|
+
description:
|
|
1069
|
+
"记录一条 AI 分析建议信号(方向/入场价/目标价/止损价/持有期限),供后续胜率评估。信号持久化在本地 JSONL($STOCK_SIGNAL_STORE 或 ~/.stock-analysis/signals.jsonl),宿主 Agent 自行决定何时 record/evaluate",
|
|
1070
|
+
parameters: Type.Object({
|
|
1071
|
+
symbol: Type.String({ description: "股票代码(A股如600519,美股如AAPL,港股如00700.HK)" }),
|
|
1072
|
+
direction: Type.Union([Type.Literal("buy"), Type.Literal("sell")], {
|
|
1073
|
+
description: "建议方向",
|
|
1074
|
+
}),
|
|
1075
|
+
entry_price: Type.Optional(Type.Number({ description: "入场价(可选)" })),
|
|
1076
|
+
target_price: Type.Optional(Type.Number({ description: "目标价(可选)" })),
|
|
1077
|
+
stop_price: Type.Optional(Type.Number({ description: "止损价(可选)" })),
|
|
1078
|
+
horizon_days: Type.Optional(
|
|
1079
|
+
Type.Number({ description: "持有期限(交易日),默认 10" })
|
|
1080
|
+
),
|
|
1081
|
+
source: Type.Optional(
|
|
1082
|
+
Type.String({ description: "信号来源(如触发该建议的 skill 名)" })
|
|
1083
|
+
),
|
|
1084
|
+
note: Type.Optional(Type.String({ description: "备注(可选)" })),
|
|
1085
|
+
}),
|
|
1086
|
+
async execute(_id, params) {
|
|
1087
|
+
const args = [
|
|
1088
|
+
"record",
|
|
1089
|
+
params.symbol,
|
|
1090
|
+
"--direction",
|
|
1091
|
+
params.direction,
|
|
1092
|
+
"--horizon-days",
|
|
1093
|
+
String(params.horizon_days ?? 10),
|
|
1094
|
+
];
|
|
1095
|
+
if (params.entry_price !== undefined) args.push("--entry-price", String(params.entry_price));
|
|
1096
|
+
if (params.target_price !== undefined) args.push("--target-price", String(params.target_price));
|
|
1097
|
+
if (params.stop_price !== undefined) args.push("--stop-price", String(params.stop_price));
|
|
1098
|
+
if (params.source) args.push("--source", params.source);
|
|
1099
|
+
if (params.note) args.push("--note", params.note);
|
|
1100
|
+
const out = await runPy("signal_tracker.py", args);
|
|
1101
|
+
return asText(out);
|
|
1102
|
+
},
|
|
1103
|
+
});
|
|
1104
|
+
|
|
1105
|
+
api.registerTool({
|
|
1106
|
+
name: "evaluate_signals",
|
|
1107
|
+
description:
|
|
1108
|
+
"评估到期信号:拉取记录日之后的日K,判定 target_hit/stop_hit/timeout 并计算收益,回写存储。记录建议用 record_signal,胜率复盘用 get_signal_summary",
|
|
1109
|
+
parameters: Type.Object({
|
|
1110
|
+
symbol: Type.Optional(
|
|
1111
|
+
Type.String({ description: "股票代码(可选,只评估该股的信号)" })
|
|
1112
|
+
),
|
|
1113
|
+
}),
|
|
1114
|
+
async execute(_id, params) {
|
|
1115
|
+
const args = ["evaluate"];
|
|
1116
|
+
if (params.symbol) args.push("--symbol", params.symbol);
|
|
1117
|
+
const out = await runPy("signal_tracker.py", args);
|
|
1118
|
+
return asText(out);
|
|
1119
|
+
},
|
|
1120
|
+
});
|
|
1121
|
+
|
|
1122
|
+
api.registerTool({
|
|
1123
|
+
name: "get_signal_summary",
|
|
1124
|
+
description:
|
|
1125
|
+
"信号胜率汇总(可按 source/symbol/status 过滤):胜率、平均收益、结果分布与明细",
|
|
1126
|
+
parameters: Type.Object({
|
|
1127
|
+
source: Type.Optional(Type.String({ description: "按信号来源过滤(可选)" })),
|
|
1128
|
+
symbol: Type.Optional(Type.String({ description: "按股票代码过滤(可选)" })),
|
|
1129
|
+
status: Type.Optional(
|
|
1130
|
+
Type.Union(
|
|
1131
|
+
[Type.Literal("open"), Type.Literal("closed"), Type.Literal("all")],
|
|
1132
|
+
{ description: "open=未结算,closed=已结算,all=全部(默认)" }
|
|
1133
|
+
)
|
|
1134
|
+
),
|
|
1135
|
+
}),
|
|
1136
|
+
async execute(_id, params) {
|
|
1137
|
+
const args = ["summary"];
|
|
1138
|
+
if (params.source) args.push("--source", params.source);
|
|
1139
|
+
if (params.symbol) args.push("--symbol", params.symbol);
|
|
1140
|
+
args.push("--status", params.status ?? "all");
|
|
1141
|
+
const out = await runPy("signal_tracker.py", args);
|
|
1142
|
+
return asText(out);
|
|
1143
|
+
},
|
|
1144
|
+
});
|
|
1145
|
+
|
|
999
1146
|
api.registerTool({
|
|
1000
1147
|
name: "parse_stock_list",
|
|
1001
1148
|
description:
|
package/openclaw.plugin.json
CHANGED
|
@@ -18,6 +18,9 @@
|
|
|
18
18
|
"get_stock_info",
|
|
19
19
|
"get_chip_distribution",
|
|
20
20
|
"get_market_stats",
|
|
21
|
+
"get_limit_up_pool",
|
|
22
|
+
"get_dragon_tiger",
|
|
23
|
+
"get_hot_stocks",
|
|
21
24
|
"get_fundamental_context",
|
|
22
25
|
"screen_stocks",
|
|
23
26
|
"run_backtest",
|
|
@@ -25,6 +28,7 @@
|
|
|
25
28
|
"resolve_stock_name",
|
|
26
29
|
"check_trading_day",
|
|
27
30
|
"get_trading_days",
|
|
31
|
+
"get_trading_phase",
|
|
28
32
|
"calculate_ma",
|
|
29
33
|
"get_volume_analysis",
|
|
30
34
|
"search_stock_news",
|
|
@@ -44,6 +48,9 @@
|
|
|
44
48
|
"build_watchlist_context",
|
|
45
49
|
"analyze_position_context",
|
|
46
50
|
"check_alert_rules",
|
|
51
|
+
"record_signal",
|
|
52
|
+
"evaluate_signals",
|
|
53
|
+
"get_signal_summary",
|
|
47
54
|
"parse_stock_list"
|
|
48
55
|
]
|
|
49
56
|
},
|
package/package.json
CHANGED
|
@@ -24,6 +24,8 @@ python3 scripts/gather.py <symbol>
|
|
|
24
24
|
同时用 resolve_stock_sectors 确认个股所属板块,再用 get_sector_constituents 拉取同板块个股列表——后续「龙头 vs 跟风」的强弱对比都在这个板块池内进行。
|
|
25
25
|
获取不到板块池或池内个股同期表现时,只评估候选股的强势特征,不给出“龙头/龙一”结论。
|
|
26
26
|
|
|
27
|
+
短线情绪与资金席位补充:`get_limit_up_pool`(涨停池的连板数、首末次封板时间、封板资金、炸板次数)用于确认板块内个股的高度与封板质量;`get_dragon_tiger`(龙虎榜)用于查看上榜个股的席位净买额与上榜原因。两者在非交易日或未来日期会自动回退到最近交易日的数据(返回含 `requested_date` 与 `stale: true` 标注),解读时以 `date` 字段的实际数据日期为准,不得把回退数据当成请求日当日数据。
|
|
28
|
+
|
|
27
29
|
### 2. 相对强弱验证
|
|
28
30
|
|
|
29
31
|
在同一截止时间比较板块候选股:
|
|
@@ -33,7 +35,7 @@ python3 scripts/gather.py <symbol>
|
|
|
33
35
|
- 上涨日与下跌日的成交量结构
|
|
34
36
|
- 板块上涨时是否领涨,板块分歧时是否保持相对强度
|
|
35
37
|
|
|
36
|
-
|
|
38
|
+
连板数、封板资金、炸板次数和首末次封板时间用 `get_limit_up_pool` 获取;竞价强弱和分时承接仍需盘口或分钟数据。当前数据无法验证时明确标注缺失,不得据此评定龙头。
|
|
37
39
|
|
|
38
40
|
### 3. 判断阶段与计划
|
|
39
41
|
|
|
@@ -17,6 +17,8 @@ description: 市场情绪周期:用市场宽度、涨跌停、成交额和热
|
|
|
17
17
|
python3 scripts/gather.py [A|HK|US]
|
|
18
18
|
```
|
|
19
19
|
|
|
20
|
+
A 股情绪另有两个直接数据源:`get_limit_up_pool`(涨停池:连板梯队高度、炸板率、封板资金)与 `get_hot_stocks`(全市场人气热搜榜)。`get_limit_up_pool` 在非交易日或未来日期会回退到最近交易日数据(返回含 `requested_date` 与 `stale: true`),情绪判断以其 `date` 字段的实际数据日期为准。
|
|
21
|
+
|
|
20
22
|
### 2. 情绪指标
|
|
21
23
|
|
|
22
24
|
- 市场温度和策略姿态
|
|
@@ -20,7 +20,8 @@ gather 工具返回:
|
|
|
20
20
|
- `financials` — 基本面数据(实质受益判断)
|
|
21
21
|
- `news` — 近期新闻(题材催化来源)
|
|
22
22
|
- `stock_info` — 公司基本信息(行业、业务)
|
|
23
|
-
- `sector_rankings` —
|
|
23
|
+
- `sector_rankings` — 板块排名(核心数据源);`get_sector_rankings` 传 `board_type=concept` 时为概念板块排行,热点题材以概念口径为主
|
|
24
|
+
- `hot_stocks` — 全市场人气热搜榜(`get_hot_stocks`,东方财富人气榜),辅助判断题材热度
|
|
24
25
|
|
|
25
26
|
评估扩散度前,必须获取板块成分股及其当日表现;只有板块排名时,仅可判断当日相对强弱,不判断扩散度或持续性。
|
|
26
27
|
|
|
@@ -30,6 +30,8 @@ python3 scripts/gather.py <symbol>
|
|
|
30
30
|
|
|
31
31
|
解析返回的 JSON 数据。如果某个字段为 `null`,表示该数据获取失败,基于可用数据继续分析。
|
|
32
32
|
|
|
33
|
+
解读实时行情前先调 `get_trading_phase` 确认该市场当前盘中阶段(盘前/早盘/午间休市/午盘/交易中/盘后/休市),避免把休市时的静态快照当作盘中信号解读。
|
|
34
|
+
|
|
33
35
|
### 第二步:综合研判
|
|
34
36
|
|
|
35
37
|
根据获取的数据进行多维度分析:
|
|
@@ -63,11 +65,17 @@ python3 scripts/gather.py <symbol>
|
|
|
63
65
|
|
|
64
66
|
### 第三步:渲染研报
|
|
65
67
|
|
|
66
|
-
1. 按 [报告 schema](
|
|
68
|
+
1. 按 [报告 schema](../../schemas/report_schema.json) 构建结构化报告。
|
|
67
69
|
2. 每个结论只使用成功返回的数据;缺失维度在 `risk_warning` 中说明影响。
|
|
68
70
|
3. 调用 `render_stock_report`:快速问答用 `brief`,完整研判用 `full`。
|
|
69
71
|
4. 输出渲染后的 Markdown;只在用户要求机器可读数据时附加结构化 JSON。
|
|
70
72
|
|
|
73
|
+
## 信号跟踪闭环
|
|
74
|
+
|
|
75
|
+
- 给出明确买卖建议(方向 + 入场价/目标价/止损价)时,调 `record_signal` 存档,`source` 填触发该建议的 skill 名(如 `stock-analysis`、`dragon-head`)。
|
|
76
|
+
- 后续会话用 `evaluate_signals` 结算到期信号(target_hit/stop_hit/timeout 并回写收益),用 `get_signal_summary` 复盘胜率(可按 source/symbol/status 过滤)。
|
|
77
|
+
- 信号持久化在本地 JSONL(`$STOCK_SIGNAL_STORE` 或 `~/.stock-analysis/signals.jsonl`);是否记录由宿主 Agent 决定,不阻塞报告输出。
|
|
78
|
+
|
|
71
79
|
## 注意事项
|
|
72
80
|
- 始终提供风险提示
|
|
73
81
|
- 不做绝对化的涨跌预测
|