@weaxs/openclaw-stock-analysis 0.2.4 → 0.2.6
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/dist/index.js +149 -15
- package/index.ts +158 -14
- package/openclaw.plugin.json +10 -1
- package/package.json +1 -1
- package/schemas/report_schema.json +3 -3
- package/scripts/setup-python.mjs +6 -6
- package/skills/bull-trend/SKILL.md +34 -10
- package/skills/bull-trend/references/fat-tails.md +91 -0
- package/skills/bull-trend/scripts/tail_analysis.py +132 -0
- package/skills/event-driven/SKILL.md +8 -0
- package/skills/growth-quality/SKILL.md +8 -0
- package/skills/stock-analysis/SKILL.md +31 -3
- package/skills/stock-screener/SKILL.md +20 -0
- package/skills/strategy-backtest/SKILL.md +6 -0
- package/skills/wisburg-research/SKILL.md +2 -0
- package/templates/stock_analysis/brief.md.j2 +4 -1
- package/templates/stock_analysis/full.md.j2 +6 -3
- package/tools/_cache.py +61 -0
- package/tools/alert_rules.py +32 -4
- package/tools/backtest.py +22 -4
- package/tools/capabilities.py +12 -0
- package/tools/diagnostics.py +6 -0
- package/tools/gather.py +20 -10
- package/tools/lixinger.py +100 -0
- package/tools/market_regime.py +7 -3
- package/tools/market_review.py +7 -6
- package/tools/position_context.py +20 -2
- package/tools/report_renderer.py +2 -0
- package/tools/risk_screening.py +45 -17
- package/tools/screener.py +64 -4
- package/tools/sec_edgar.py +346 -0
- package/tools/sec_holders.py +263 -0
- package/tools/signal_tracker.py +142 -19
- package/tools/stock_data.py +321 -116
- package/tools/technical.py +16 -2
- package/tools/value_data.py +1527 -0
- package/tools/watchlist.py +24 -1
- package/tools/watchlist_context.py +7 -3
package/dist/index.js
CHANGED
|
@@ -4427,8 +4427,18 @@ __export(typebox_exports, {
|
|
|
4427
4427
|
import { definePluginEntry } from "openclaw/plugin-sdk/plugin-entry";
|
|
4428
4428
|
var defaultExecutor = async (bin, argv) => {
|
|
4429
4429
|
const exec = promisify(cp.execFile);
|
|
4430
|
-
|
|
4431
|
-
|
|
4430
|
+
try {
|
|
4431
|
+
const { stdout } = await exec(bin, argv, { maxBuffer: 32 * 1024 * 1024 });
|
|
4432
|
+
return stdout;
|
|
4433
|
+
} catch (error) {
|
|
4434
|
+
const stdout = error.stdout;
|
|
4435
|
+
try {
|
|
4436
|
+
const data = JSON.parse(stdout ?? "");
|
|
4437
|
+
if (data && typeof data.error === "string") return stdout;
|
|
4438
|
+
} catch {
|
|
4439
|
+
}
|
|
4440
|
+
return JSON.stringify({ error: "Python command failed; check interpreter/dependencies" });
|
|
4441
|
+
}
|
|
4432
4442
|
};
|
|
4433
4443
|
var executor = defaultExecutor;
|
|
4434
4444
|
function __setExecutor(fn) {
|
|
@@ -4448,6 +4458,7 @@ var index_default = definePluginEntry({
|
|
|
4448
4458
|
description: "Stock analysis, screening, and strategy backtesting across A/HK/US/JP/KR/TW markets",
|
|
4449
4459
|
register(api) {
|
|
4450
4460
|
const repoRoot = api.rootDir || fallbackRoot;
|
|
4461
|
+
const runtimeToolsDir = existsSync(join(repoRoot, "tools")) ? join(repoRoot, "tools") : toolsDir;
|
|
4451
4462
|
const pythonBin = () => {
|
|
4452
4463
|
const venvPython = join(repoRoot, venvBin);
|
|
4453
4464
|
if (existsSync(venvPython)) return venvPython;
|
|
@@ -4455,10 +4466,129 @@ var index_default = definePluginEntry({
|
|
|
4455
4466
|
if (existsSync(parentVenvPython)) return parentVenvPython;
|
|
4456
4467
|
return isWin ? "python" : "python3";
|
|
4457
4468
|
};
|
|
4458
|
-
const runPy = (script, args) => executor(pythonBin(), [join(
|
|
4469
|
+
const runPy = (script, args) => executor(pythonBin(), [join(runtimeToolsDir, script), ...args]);
|
|
4470
|
+
api.registerTool({
|
|
4471
|
+
name: "get_announcements",
|
|
4472
|
+
description: "\u67E5\u8BE2A\u80A1\u5DE8\u6F6E\u516C\u544A\u6807\u9898\u3001\u65E5\u671F\u3001\u7C7B\u578B\u548C\u539F\u6587PDF\u94FE\u63A5\uFF1B\u6309\u65E5\u671F\u8303\u56F4/\u7C7B\u522B\u7B5B\u9009\uFF0C\u9ED8\u8BA4\u8FD190\u5929\uFF0Ctop=1..500\u3002\u7B2C\u4E00\u7248\u4E0D\u63D0\u53D6\u6B63\u6587\uFF0Ctruncated\u63D0\u793A\u622A\u65AD\u3002",
|
|
4473
|
+
parameters: typebox_exports.Object({
|
|
4474
|
+
symbol: typebox_exports.String({ description: "A\u80A1\u4EE3\u7801" }),
|
|
4475
|
+
category: typebox_exports.Optional(typebox_exports.Union([typebox_exports.Literal("all"), typebox_exports.Literal("forecast"), typebox_exports.Literal("express"), typebox_exports.Literal("annual"), typebox_exports.Literal("interim"), typebox_exports.Literal("quarterly"), typebox_exports.Literal("reduction"), typebox_exports.Literal("issuance"), typebox_exports.Literal("inquiry"), typebox_exports.Literal("dividend")], { description: "\u516C\u544A\u7C7B\u522B\uFF0C\u9ED8\u8BA4all" })),
|
|
4476
|
+
start_date: typebox_exports.Optional(typebox_exports.String({ description: "\u5F00\u59CB\u65E5\u671FYYYY-MM-DD\uFF0C\u9ED8\u8BA4\u7ED3\u675F\u65E5\u671F\u524D90\u5929" })),
|
|
4477
|
+
end_date: typebox_exports.Optional(typebox_exports.String({ description: "\u7ED3\u675F\u65E5\u671FYYYY-MM-DD\uFF0C\u9ED8\u8BA4\u4ECA\u5929" })),
|
|
4478
|
+
top: typebox_exports.Optional(typebox_exports.Number({ description: "\u6700\u591A\u6761\u65701..500\uFF0C\u9ED8\u8BA450" }))
|
|
4479
|
+
}),
|
|
4480
|
+
async execute(_id, p) {
|
|
4481
|
+
const out = await runPy("value_data.py", ["announcements", p.symbol, "--category", p.category ?? "all", "--start-date", p.start_date ?? "", "--end-date", p.end_date ?? "", "--top", String(p.top ?? 50)]);
|
|
4482
|
+
return asText(out);
|
|
4483
|
+
}
|
|
4484
|
+
});
|
|
4485
|
+
api.registerTool({
|
|
4486
|
+
name: "get_us_holdings",
|
|
4487
|
+
description: "\u67E5\u8BE2SEC 13F\uFF1Amode=auto\u9ED8\u8BA4\u670913F\u7533\u62A5\u65F6\u67E5\u673A\u6784\uFF0C\u5426\u5219\u6309\u53D1\u884C\u4EBACIK\u53CD\u67E5\u6301\u4ED3\u673A\u6784\uFF1Bmanager/issuer\u53EF\u663E\u5F0F\u6307\u5B9A\u3002\u53D1\u884C\u4EBA\u901A\u8FC7\u5B98\u65B913D/G\u7CBE\u786E\u6620\u5C04CUSIP\uFF0C\u626B\u63CF\u6700\u65B0\u5DF2\u53D1\u5E0313F\u7A97\u53E3\uFF0C\u5904\u7406\u91CD\u8FF0/\u8865\u5145\u4FEE\u8BA2\uFF0C\u8FD4\u56DE\u5B9E\u9645\u62A5\u544A\u671F\u3001\u622A\u6B62\u65E5\u53CA\u6620\u5C04\u8986\u76D6\u3002\u9996\u6B21\u7EA6100MB\u4E0B\u8F7D\uFF0C\u540E\u7EED\u7F13\u5B58\uFF1B\u65E0\u6620\u5C04\u660E\u786E\u62A5\u9519\uFF0C\u4E0D\u505A\u540D\u79F0\u731C\u6D4B\u3002\u9700SEC_USER_AGENT\u542B\u771F\u5B9E\u8054\u7CFB\u90AE\u7BB1\uFF0C\u4E0D\u662F\u5B9E\u65F6\u6216\u5168\u90E8\u8BC1\u5238\u6301\u4ED3\u3002",
|
|
4488
|
+
parameters: typebox_exports.Object({
|
|
4489
|
+
cik: typebox_exports.String({ description: "\u673A\u6784\u6216\u53D1\u884C\u4EBACIK\uFF0C1..10\u4F4D\u6570\u5B57\uFF0C\u59820001067983/0000320193" }),
|
|
4490
|
+
mode: typebox_exports.Optional(typebox_exports.Union([typebox_exports.Literal("auto"), typebox_exports.Literal("manager"), typebox_exports.Literal("issuer")], { description: "\u9ED8\u8BA4auto\uFF1Bmanager\u67E5\u673A\u6784\u7EC4\u5408\uFF0Cissuer\u53CD\u67E5\u53D1\u884C\u4EBA\u6301\u4ED3\u673A\u6784" }))
|
|
4491
|
+
}),
|
|
4492
|
+
async execute(_id, p) {
|
|
4493
|
+
const out = await runPy("sec_edgar.py", ["holdings", p.cik, ...p.mode ? ["--mode", p.mode] : []]);
|
|
4494
|
+
return asText(out);
|
|
4495
|
+
}
|
|
4496
|
+
});
|
|
4497
|
+
api.registerTool({
|
|
4498
|
+
name: "get_insider_trades",
|
|
4499
|
+
description: "\u67E5\u8BE2\u7F8E\u80A1\u53D1\u884C\u4EBA\u8FD1\u671FForm 4/4-A\u5185\u90E8\u4EBA\u4EA4\u6613\uFF08SEC\u5B98\u65B9XML\uFF09\uFF0C\u4FDD\u7559\u4EBA\u5458\u804C\u52A1\u3001\u4EA4\u6613\u4EE3\u7801\u3001\u4E70\u5356\u65B9\u5411\u3001\u6570\u91CF\u3001\u4EF7\u683C\u3001\u811A\u6CE8\u548C\u884D\u751F\u54C1\u6807\u5FD7\u3002\u9700SEC_USER_AGENT\u542B\u771F\u5B9E\u8054\u7CFB\u90AE\u7BB1\uFF1Bdays\u6309\u7533\u62A5\u65E5\u671F\u7B5B\u9009\uFF0Ctop\u9650\u5236\u6587\u4EF6\u6570\uFF0C\u4FEE\u8BA2\u52FF\u91CD\u590D\u8BA1\u6570\u3002",
|
|
4500
|
+
parameters: typebox_exports.Object({
|
|
4501
|
+
symbol: typebox_exports.String({ description: "\u7F8E\u80A1ticker\u6216\u53D1\u884C\u4EBACIK" }),
|
|
4502
|
+
days: typebox_exports.Optional(typebox_exports.Number({ description: "\u7533\u62A5\u65E5\u671F\u7A97\u53E31..365\u5929\uFF0C\u9ED8\u8BA490" })),
|
|
4503
|
+
top: typebox_exports.Optional(typebox_exports.Number({ description: "\u6700\u591A\u89E3\u6790Form 4\u6587\u4EF6\u65701..20\uFF0C\u9ED8\u8BA410" }))
|
|
4504
|
+
}),
|
|
4505
|
+
async execute(_id, p) {
|
|
4506
|
+
const out = await runPy("sec_edgar.py", ["insider_trades", p.symbol, "--days", String(p.days ?? 90), "--top", String(p.top ?? 10)]);
|
|
4507
|
+
return asText(out);
|
|
4508
|
+
}
|
|
4509
|
+
});
|
|
4510
|
+
api.registerTool({
|
|
4511
|
+
name: "get_valuation_history",
|
|
4512
|
+
description: "\u67E5\u8BE2A/HK\u80A1\u7968\u5386\u53F2PE-TTM/PB\u3001\u5F53\u524D\u6B63\u503C\u5206\u4F4D\u548C10/25/50/75/90\u5206\u4F4DBand\uFF0C\u8FD4\u56DE\u5B9E\u9645\u91C7\u6837\u533A\u95F4\uFF1B\u4E8F\u635F\u4F30\u503C\u5206\u4F4D\u4E3Anull\u3002years=1..10\uFF0C\u6309\u5929\u7F13\u5B58\u3002HK\u914D\u7F6ELIXINGER_TOKEN\u65F6\u4F18\u5148\u7406\u674F\u4EC1\u975E\u91D1\u878D\u516C\u53F8\u65E5\u5386\u53F2\uFF0C\u5931\u8D25\u964D\u7EA7\u767E\u5EA6\uFF0C\u4E0D\u6DF7\u63A5\u6765\u6E90\u3002",
|
|
4513
|
+
parameters: typebox_exports.Object({
|
|
4514
|
+
symbol: typebox_exports.String({ description: "A\u80A1\u4EE3\u7801\u6216\u6E2F\u80A1.HK\u4EE3\u7801" }),
|
|
4515
|
+
years: typebox_exports.Optional(typebox_exports.Number({ description: "\u5386\u53F2\u7A97\u53E3\u5E74\u65701..10\uFF0C\u9ED8\u8BA45" }))
|
|
4516
|
+
}),
|
|
4517
|
+
async execute(_id, p) {
|
|
4518
|
+
const out = await runPy("value_data.py", ["valuation_history", p.symbol, "--years", String(p.years ?? 5)]);
|
|
4519
|
+
return asText(out);
|
|
4520
|
+
}
|
|
4521
|
+
});
|
|
4522
|
+
api.registerTool({
|
|
4523
|
+
name: "get_index_valuation",
|
|
4524
|
+
description: "\u67E5\u8BE2\u4E2D\u56FD\u6307\u6570\u4F30\u503C\u5386\u53F2\u5206\u4F4D\u4E0EBand\uFF1B\u4E50\u5495\u4E50\u80A1PE/PB\u4F18\u5148\uFF0C\u4E2D\u8BC1\u5B98\u65B9\u5386\u53F2\u8865\u5145\u6EDA\u52A8PE\u5E76\u4FDD\u7559\u8FD1\u671FPE1\u53E3\u5F84\u3002\u7F3APB\u65F6\u53EF\u7528LIXINGER_TOKEN\u8865\u5145\u7406\u674F\u4EC1mcw\u5386\u53F2\uFF0C\u6765\u6E90\u4E0E\u7B97\u6CD5\u5206\u522B\u6807\u660E\uFF0C\u4E0D\u6DF7\u63A5\u540C\u4E00\u6307\u6807\u3002",
|
|
4525
|
+
parameters: typebox_exports.Object({
|
|
4526
|
+
symbol: typebox_exports.String({ description: "\u6307\u6570\u4EE3\u7801\u6216\u540D\u79F0\uFF0C\u5982000300\u3001\u6CAA\u6DF1300\u3001000985" }),
|
|
4527
|
+
years: typebox_exports.Optional(typebox_exports.Number({ description: "\u5386\u53F2\u7A97\u53E3\u5E74\u65701..10\uFF0C\u9ED8\u8BA45" }))
|
|
4528
|
+
}),
|
|
4529
|
+
async execute(_id, p) {
|
|
4530
|
+
const out = await runPy("value_data.py", ["index_valuation", p.symbol, "--years", String(p.years ?? 5)]);
|
|
4531
|
+
return asText(out);
|
|
4532
|
+
}
|
|
4533
|
+
});
|
|
4534
|
+
api.registerTool({
|
|
4535
|
+
name: "get_earnings_calendar",
|
|
4536
|
+
description: "\u67E5\u8BE2\u8D22\u62A5\u65E5\u5386\uFF1AA\u80A1report_date\u5FC5\u586B\u5B63\u5EA6\u671F\u672B\uFF0C\u8FD4\u56DE\u9884\u7EA6/\u4FEE\u8BA2/\u5B9E\u9645\u62AB\u9732\u4E0E\u4E1A\u7EE9\u9884\u544A\uFF1BHK\u9700symbol\uFF0C\u4F18\u5148HKEX\u5DF2\u516C\u544A\u4E1A\u7EE9\u5BA1\u6279\u8463\u4E8B\u4F1A\u6392\u671F\uFF08\u4E0D\u662F\u5B9E\u9645\u62AB\u9732\u65E5\uFF09\uFF0C\u7F3A\u5931\u65F6\u8FD4\u56DE\u4F9B\u5E94\u5546\u65E5\u671F\u3002HK\u53EF\u6309\u5DF2\u77E5\u8D22\u653F\u671F\u672B\u8FC7\u6EE4\uFF0C\u672A\u77E5\u671F\u6B21\u53E6\u5217\u3002",
|
|
4537
|
+
parameters: typebox_exports.Object({
|
|
4538
|
+
report_date: typebox_exports.Optional(typebox_exports.String({ description: "A\u80A1\u5FC5\u586B\u5B63\u5EA6\u671F\u672BYYYY-MM-DD\uFF1BHK\u53EF\u9009\u5DF2\u516C\u544A\u8D22\u653F\u671F\u672B\uFF0C\u672A\u77E5\u671F\u6B21\u53E6\u5217" })),
|
|
4539
|
+
symbol: typebox_exports.Optional(typebox_exports.String({ description: "A\u80A1\u4EE3\u7801\u53EF\u9009\uFF08\u7701\u7565\u67E5\u5168\u5E02\u573A\uFF09\uFF1BHK\u5FC5\u987B\u63D0\u4F9B\u6E2F\u80A1.HK\u4EE3\u7801" })),
|
|
4540
|
+
top: typebox_exports.Optional(typebox_exports.Number({ description: "\u6BCF\u7C7B\u6700\u591A\u8FD4\u56DE\u6761\u65701..500\uFF0C\u9ED8\u8BA450" }))
|
|
4541
|
+
}),
|
|
4542
|
+
async execute(_id, p) {
|
|
4543
|
+
const out = await runPy("value_data.py", ["earnings_calendar", "--report-date", p.report_date ?? "", "--symbol", p.symbol ?? "", "--top", String(p.top ?? 50)]);
|
|
4544
|
+
return asText(out);
|
|
4545
|
+
}
|
|
4546
|
+
});
|
|
4547
|
+
api.registerTool({
|
|
4548
|
+
name: "get_shareholder_structure",
|
|
4549
|
+
description: "\u67E5\u8BE2A\u80A1\u80A1\u4E1C\u6237\u6570\u3001\u5341\u5927\u6D41\u901A\u80A1\u4E1C\u53D8\u5316\u53CA\u6CAA\u6DF1\u4EA4\u6613\u6240\u5B63\u5EA6\u5317\u5411\u5408\u8BA1\u6301\u80A1\uFF1B\u5B98\u65B9\u603B\u91CF\u4F18\u5148\uFF0C\u5341\u5927HKSCC\u540D\u4E49\u6301\u80A1\u4EC5\u515C\u5E95\u4E14\u6807\u660E\u53E3\u5F84\u3002HK\u8FD4\u56DE\u6E2F\u4EA4\u6240\u5357\u5411\u8BB0\u5F55\u3002\u7F3A\u5931\u4E0D\u5F53\u96F6\uFF0C\u671F\u672B\u4E0D\u7B49\u4E8E\u5DF2\u516C\u5E03\u3002",
|
|
4550
|
+
parameters: typebox_exports.Object({
|
|
4551
|
+
symbol: typebox_exports.String({ description: "A\u80A1\u4EE3\u7801\u6216\u6E2F\u80A1.HK\u4EE3\u7801" }),
|
|
4552
|
+
report_date: typebox_exports.Optional(typebox_exports.String({ description: "A\u80A1\u62A5\u544A\u671FYYYY-MM-DD\uFF1B\u7701\u7565\u65F6\u5317\u5411\u4F7F\u7528\u6700\u65B0\u5DF2\u516C\u5E03\u5B63\u5EA6\uFF0C\u5341\u5927\u80A1\u4E1C\u4F7F\u7528\u6700\u65B0\u8D22\u62A5\u671F\uFF1BHK\u5FFD\u7565" }))
|
|
4553
|
+
}),
|
|
4554
|
+
async execute(_id, p) {
|
|
4555
|
+
const out = await runPy("value_data.py", ["shareholder_structure", p.symbol, "--report-date", p.report_date ?? ""]);
|
|
4556
|
+
return asText(out);
|
|
4557
|
+
}
|
|
4558
|
+
});
|
|
4559
|
+
api.registerTool({
|
|
4560
|
+
name: "get_etf_details",
|
|
4561
|
+
description: "\u67E5\u8BE2A\u80A1ETF\u51C0\u503C\u6298\u6EA2\u4EF7\u3001\u89C4\u6A21\u3001\u62AB\u9732\u6301\u4ED3\u53CA\u6CAA\u6DF1\u5B8C\u6574PCF\u7533\u8D4E\u7BEE\u5B50\uFF1B\u7BEE\u5B50\u4E0D\u662F\u5B9E\u9645\u6301\u4ED3\u3002include_full_holdings=true\u53E6\u53D6\u6700\u8FD1\u53EF\u5F97\u534A\u5E74\u5EA6/\u5E74\u5EA6\u62AB\u9732\u80A1\u7968\u8868\uFF0C\u542B\u6570\u91CF/\u5E02\u503C/\u62A5\u544A\u671F\uFF0C\u975E\u5B9E\u65F6\u5168\u8D44\u4EA7\u7EC4\u5408\uFF1Bbenchmark\u7528\u4E8E\u8DDF\u8E2A\u8BEF\u5DEE\u3002",
|
|
4562
|
+
parameters: typebox_exports.Object({
|
|
4563
|
+
include_full_holdings: typebox_exports.Optional(typebox_exports.Boolean({ description: "\u8BF7\u6C42\u534A\u5E74\u5EA6/\u5E74\u5EA6\u62AB\u9732\u80A1\u7968\u8868\uFF0C\u9ED8\u8BA4false" })),
|
|
4564
|
+
symbol: typebox_exports.String({ description: "A\u80A1ETF\u4EE3\u7801\uFF0C\u5982510300" }),
|
|
4565
|
+
benchmark: typebox_exports.Optional(typebox_exports.String({ description: "\u53EF\u9009\u57FA\u51C6\u4EE3\u7801\uFF0C\u5982sh000300\uFF1B\u4E0D\u731C\u6D4B\u57FA\u51C6" })),
|
|
4566
|
+
days: typebox_exports.Optional(typebox_exports.Number({ description: "\u51C0\u503C\u7A97\u53E3\u4EA4\u6613\u65E5\u657010..252\uFF0C\u9ED8\u8BA460" }))
|
|
4567
|
+
}),
|
|
4568
|
+
async execute(_id, p) {
|
|
4569
|
+
const out = await runPy("value_data.py", ["etf_details", p.symbol, "--benchmark", p.benchmark ?? "", "--days", String(p.days ?? 60), ...p.include_full_holdings ? ["--include-full-holdings"] : []]);
|
|
4570
|
+
return asText(out);
|
|
4571
|
+
}
|
|
4572
|
+
});
|
|
4573
|
+
api.registerTool({
|
|
4574
|
+
name: "get_dividends",
|
|
4575
|
+
description: "\u67E5\u8BE2A/HK\u5206\u7EA2\u5386\u53F2\u3001\u9664\u606F\u65E5\u5386\u3001\u5DF2\u5B9E\u65BDTTM\u80A1\u606F\u4E0E\u8FDE\u7EED\u5E74\u6570\u3002mode=ranking\u7701\u7565symbol\uFF0Cmarket=A\u67E5\u62A5\u544A\u671F\u6392\u884C\uFF0Cmarket=HK\u67E5HKEX/LSEG\u5E74\u5EA6\u80A1\u606F\u7387\u6392\u884C\uFF08report_date\u987B\u5E74\u672B\uFF09\uFF1B\u6392\u884C\u5747\u975E\u5F53\u524DTTM\u6536\u76CA\u7387\u3002\u7F3A\u5931\u4E0D\u6309\u96F6\u3002",
|
|
4576
|
+
parameters: typebox_exports.Object({
|
|
4577
|
+
market: typebox_exports.Optional(typebox_exports.Union([typebox_exports.Literal("A"), typebox_exports.Literal("HK")], { description: "\u4EC5ranking\u9009\u62E9\u5E02\u573A\uFF0C\u9ED8\u8BA4A" })),
|
|
4578
|
+
symbol: typebox_exports.Optional(typebox_exports.String({ description: "history/calendar\u5FC5\u586BA\u80A1\u6216\u6E2F\u80A1.HK\u4EE3\u7801\uFF1Branking\u7701\u7565" })),
|
|
4579
|
+
mode: typebox_exports.Optional(typebox_exports.Union([typebox_exports.Literal("history"), typebox_exports.Literal("calendar"), typebox_exports.Literal("ranking")], { description: "history\u9ED8\u8BA4\uFF1Bcalendar\u672A\u6765\u5DF2\u516C\u5E03\u9664\u606F\u4E8B\u4EF6\uFF1Branking\u6309market\u67E5\u8BE2A/HK\u6392\u884C" })),
|
|
4580
|
+
report_date: typebox_exports.Optional(typebox_exports.String({ description: "ranking\u62A5\u544A\u671FYYYY-MM-DD\uFF0C\u9ED8\u8BA4\u4E0A\u4E00\u5E74\u5E74\u672B\uFF1BHK\u4EC5\u5E74\u5EA6\u5E74\u672B\u65E5\u671F" })),
|
|
4581
|
+
years: typebox_exports.Optional(typebox_exports.Number({ description: "\u5386\u53F2\u7A97\u53E3\u5E74\u65701..20\uFF0C\u9ED8\u8BA410" })),
|
|
4582
|
+
top: typebox_exports.Optional(typebox_exports.Number({ description: "\u6392\u540D\u6761\u65701..500\uFF0C\u9ED8\u8BA420" }))
|
|
4583
|
+
}),
|
|
4584
|
+
async execute(_id, p) {
|
|
4585
|
+
const out = await runPy("value_data.py", ["dividends", "--market", p.market ?? "A", "--symbol", p.symbol ?? "", "--mode", p.mode ?? "history", "--report-date", p.report_date ?? "", "--years", String(p.years ?? 10), "--top", String(p.top ?? 20)]);
|
|
4586
|
+
return asText(out);
|
|
4587
|
+
}
|
|
4588
|
+
});
|
|
4459
4589
|
api.registerTool({
|
|
4460
4590
|
name: "get_kline",
|
|
4461
|
-
description: "\u83B7\u53D6\u80A1\u7968K\u7EBF\u6570\u636E\uFF08OHLCV\uFF09\u3002\u652F\u6301A\u80A1\uFF08\u5982600519\uFF09\u3001\u6E2F\u80A1\uFF08\u598200700.HK\uFF09\u3001\u7F8E\u80A1\uFF08\u5982AAPL\uFF09\u3001\u65E5\u80A1\uFF08\u59827203.T\uFF09\u3001\u97E9\u80A1\uFF08\u5982005930.KS\uFF09\u3001\u53F0\u80A1\uFF08\u59822330.TW\uFF09\u53CAA\u80A1ETF\
|
|
4591
|
+
description: "\u83B7\u53D6\u80A1\u7968K\u7EBF\u6570\u636E\uFF08OHLCV\uFF09\u3002\u652F\u6301A\u80A1\uFF08\u5982600519\uFF09\u3001\u6E2F\u80A1\uFF08\u598200700.HK\uFF09\u3001\u7F8E\u80A1\uFF08\u5982AAPL\uFF09\u3001\u65E5\u80A1\uFF08\u59827203.T\uFF09\u3001\u97E9\u80A1\uFF08\u5982005930.KS\uFF09\u3001\u53F0\u80A1\uFF08\u59822330.TW\uFF09\u53CAA\u80A1ETF\u3002A\u80A1\u80A1\u7968/ETF\u8FD4\u56DE\u524D\u590D\u6743\u4EF7\u683C\uFF0C\u6BCF\u6761\u8BB0\u5F55 adjusted=qfq\uFF1Bsh000xxx/sz399xxx \u6307\u6570\u8FD4\u56DE\u539F\u59CB\u70B9\u4F4D\uFF0Cadjusted=none\u3002\u9700\u8981\u5386\u53F2\u4EF7\u683C\u81EA\u884C\u8BA1\u7B97\u6216\u753B\u56FE\u65F6\u7528\uFF1B\u53EA\u95EE\u6307\u6807\u7528 get_technical_analysis\uFF0C\u53EA\u95EE\u73B0\u4EF7\u7528 get_quote",
|
|
4462
4592
|
parameters: typebox_exports.Object({
|
|
4463
4593
|
symbol: typebox_exports.String({
|
|
4464
4594
|
description: "\u80A1\u7968\u4EE3\u7801\uFF0C\u5982 600519\uFF08A\u80A1\uFF09\u300100700.HK\uFF08\u6E2F\u80A1\uFF09\u3001AAPL\uFF08\u7F8E\u80A1\uFF09\u30017203.T\uFF08\u65E5\u80A1\uFF09\u3001005930.KS\uFF08\u97E9\u80A1\uFF09\u30012330.TW\uFF08\u53F0\u80A1\uFF09"
|
|
@@ -4541,16 +4671,18 @@ var index_default = definePluginEntry({
|
|
|
4541
4671
|
});
|
|
4542
4672
|
api.registerTool({
|
|
4543
4673
|
name: "get_financials",
|
|
4544
|
-
description: "\u83B7\u53D6\u80A1\u7968\u8D22\u52A1\u6458\u8981\u3002A\
|
|
4674
|
+
description: "\u83B7\u53D6\u80A1\u7968\u8D22\u52A1\u6458\u8981\u53CA\u5386\u53F2\u8D8B\u52BF\uFF0C\u6309\u5929\u7F13\u5B58\u3002A\u80A1annual=true\u4E0Eperiods=10\u53D6\u5341\u5E74\u5E74\u62A5\uFF1B\u6E2F\u80A1\u53EF\u914D\u7F6ELIXINGER_TOKEN\u53D6\u975E\u91D1\u878D\u516C\u53F8\u8D22\u52A1\u5E8F\u5217\uFF0C\u4FDD\u7559\u5E01\u79CD/\u62AB\u9732\u65E5/\u5B9E\u9645\u8D22\u5E74\uFF0C\u5386\u53F2\u6BD4\u7387\u5355\u4F4Dpercent\u3002\u6709\u6548Yahoo\u9876\u5C42\u5FEB\u7167\u6309\u6574\u7EC4\u4FDD\u7559\uFF0Ccurrency\u4E3A\u8D22\u62A5\u5E01\u79CD\u3001market_cap_currency\u4E3A\u5E02\u503C\u5E01\u79CD\u3001snapshot_source\u6807\u660E\u6765\u6E90\uFF1B\u7F3A\u5931\u503C\u53CAreport_date\u4E0D\u6DF7\u5165\u5386\u53F2\u6570\u503C/\u65E5\u671F\u3002\u7F3Atoken\u6216\u65E0\u6743\u9650\u964D\u7EA7\u539F\u6709\u6765\u6E90\u5E76\u6807\u6CE8\u4E0D\u8DB3\uFF0C\u4E0D\u8865\u9020\u7F3A\u5931\u3002\u4F30\u503C\u5386\u53F2\u7528get_valuation_history\uFF0C\u62AB\u9732\u6392\u671F\u7528get_earnings_calendar",
|
|
4545
4675
|
parameters: typebox_exports.Object({
|
|
4546
4676
|
symbol: typebox_exports.String({ description: "\u80A1\u7968\u4EE3\u7801\uFF08A\u80A1\u5982600519\uFF0C\u7F8E\u80A1\u5982AAPL\uFF0C\u6E2F\u80A1\u598200700.HK\uFF09" }),
|
|
4677
|
+
annual: typebox_exports.Optional(typebox_exports.Boolean({ description: "\u53EA\u53D6\u5E74\u5EA6\u62A5\u544A\uFF0C\u9ED8\u8BA4false" })),
|
|
4547
4678
|
periods: typebox_exports.Optional(
|
|
4548
|
-
typebox_exports.Number({ description: "\u8FD4\u56DE\u6700\u8FD1N\u4E2A\u62A5\u544A\
|
|
4679
|
+
typebox_exports.Number({ description: "\u8FD4\u56DE\u6700\u8FD1N\u4E2A\u62A5\u544A\u671F1..40\uFF0C\u9ED8\u8BA41\uFF1Bannual=true\u65F6periods=10\u8BF7\u6C4210\u5E74\u5E74\u62A5" })
|
|
4549
4680
|
)
|
|
4550
4681
|
}),
|
|
4551
4682
|
async execute(_id, params) {
|
|
4552
4683
|
const args = ["financials", params.symbol];
|
|
4553
|
-
if (params.periods && params.periods
|
|
4684
|
+
if (params.periods !== void 0 && params.periods !== 1) args.push("--periods", String(params.periods));
|
|
4685
|
+
if (params.annual) args.push("--annual");
|
|
4554
4686
|
const out = await runPy("stock_data.py", args);
|
|
4555
4687
|
return asText(out);
|
|
4556
4688
|
}
|
|
@@ -4671,7 +4803,7 @@ var index_default = definePluginEntry({
|
|
|
4671
4803
|
});
|
|
4672
4804
|
api.registerTool({
|
|
4673
4805
|
name: "get_sector_constituents",
|
|
4674
|
-
description: "\u67E5\u8BE2A\u80A1\u677F\u5757\u6210\u5206\u80A1\uFF08\u6B63\u5411\u6620\u5C04\uFF1A\u677F\u5757\u2192\u80A1\u7968\u5217\u8868\uFF09\u3002\u677F\u5757\u540D\u652F\u6301\u6A21\u7CCA\u5339\u914D\uFF08\u5982\u300C\u521B\u65B0\u836F\u300D\u81EA\u52A8\u89E3\u6790\u5230\u7CBE\u786E\u677F\u5757\u540D\uFF09\uFF0C\u4E1C\u8D22\u884C\u4E1A/\u6982\u5FF5 + \u65B0\u6D6A\u591A\u6E90 failover\uFF0C\u7ED3\u679C\u7F13\
|
|
4806
|
+
description: "\u67E5\u8BE2A\u80A1\u677F\u5757\u6210\u5206\u80A1\uFF08\u6B63\u5411\u6620\u5C04\uFF1A\u677F\u5757\u2192\u80A1\u7968\u5217\u8868\uFF09\u3002\u677F\u5757\u540D\u652F\u6301\u6A21\u7CCA\u5339\u914D\uFF08\u5982\u300C\u521B\u65B0\u836F\u300D\u81EA\u52A8\u89E3\u6790\u5230\u7CBE\u786E\u677F\u5757\u540D\uFF09\uFF0C\u4E1C\u8D22\u884C\u4E1A/\u6982\u5FF5 + \u65B0\u6D6A\u591A\u6E90 failover\uFF0C\u7ED3\u679C\u6309\u7528\u6237\u76EE\u5F55\u7F13\u5B587\u5929\u3002\u4EC5\u652F\u6301A\u80A1\uFF1B\u53CD\u5411\u67E5\u4E2A\u80A1\u6240\u5C5E\u677F\u5757\u7528 resolve_stock_sectors",
|
|
4675
4807
|
parameters: typebox_exports.Object({
|
|
4676
4808
|
sector: typebox_exports.String({ description: "\u677F\u5757\u540D\u79F0\uFF08\u53EF\u6A21\u7CCA\uFF0C\u5982 \u521B\u65B0\u836F\u3001\u534A\u5BFC\u4F53\uFF09" }),
|
|
4677
4809
|
board_type: typebox_exports.Optional(
|
|
@@ -4796,9 +4928,10 @@ var index_default = definePluginEntry({
|
|
|
4796
4928
|
});
|
|
4797
4929
|
api.registerTool({
|
|
4798
4930
|
name: "get_margin_trading",
|
|
4799
|
-
description: "\u83B7\u53D6A\u80A1\u4E2A\u80A1\u878D\u8D44\u878D\u5238\u660E\u7EC6\uFF08\u878D\u8D44\u4F59\u989D/\u878D\u8D44\u4E70\u5165\u989D/\u878D\u5238\u4F59\u91CF\u7B49\uFF0C\u4E0A\u4EA4\u6240/\u6DF1\u4EA4\u6240\u5B98\u65B9\u6570\u636E\u6309\u4EA4\u6613\u6240\u5206\u6D41\uFF09\uFF0C\u8FD4\u56DE\u6700\u8FD1N\u4E2A\u4EA4\u6613\u65E5\u5E8F\u5217\uFF08\u6700\u65B0\u5728\u524D\uFF09\u3002\u91D1\u989D\u5355\u4F4D\u4E3A\u5143\uFF0Cshort_*_shares \u5355\u4F4D\u4E3A\u80A1\u3002\u4EC5\u4E24\u878D\u6807\u7684\u6709\u6570\u636E\uFF0C\u975E\u4E24\u878D\u6807\u7684\u8FD4\u56DE\u9519\u8BEF",
|
|
4931
|
+
description: "\u83B7\u53D6A\u80A1\u4E2A\u80A1\u878D\u8D44\u878D\u5238\u660E\u7EC6\uFF08\u878D\u8D44\u4F59\u989D/\u878D\u8D44\u4E70\u5165\u989D/\u878D\u5238\u4F59\u91CF\u7B49\uFF0C\u4E0A\u4EA4\u6240/\u6DF1\u4EA4\u6240\u5B98\u65B9\u6570\u636E\u6309\u4EA4\u6613\u6240\u5206\u6D41\uFF09\uFF0C\u8FD4\u56DE\u6700\u8FD1N\u4E2A\u4EA4\u6613\u65E5\u5E8F\u5217\uFF08\u6700\u65B0\u5728\u524D\uFF09\u3002\u91D1\u989D\u5355\u4F4D\u4E3A\u5143\uFF0Cshort_*_shares \u5355\u4F4D\u4E3A\u80A1\u3002include_ratio=true\u8FFD\u52A0\u540C\u65E5\u878D\u8D44\u4E70\u5165/\u6210\u4EA4\u989D\u767E\u5206\u6BD4\uFF08margin_buy_ratio_pct\uFF09\uFF0C\u7F3A\u5C11\u540C\u65E5\u5143\u53E3\u5F84\u6210\u4EA4\u989D\u5219\u4E3Anull\u3002\u4EC5\u4E24\u878D\u6807\u7684\u6709\u6570\u636E\uFF0C\u975E\u4E24\u878D\u6807\u7684\u8FD4\u56DE\u9519\u8BEF",
|
|
4800
4932
|
parameters: typebox_exports.Object({
|
|
4801
4933
|
symbol: typebox_exports.String({ description: "A\u80A1\u80A1\u7968\u4EE3\u7801\uFF0C\u5982 600519" }),
|
|
4934
|
+
include_ratio: typebox_exports.Optional(typebox_exports.Boolean({ description: "\u8FFD\u52A0\u540C\u65E5\u878D\u8D44\u4E70\u5165\u5360\u6BD4\uFF0C\u9ED8\u8BA4false" })),
|
|
4802
4935
|
days: typebox_exports.Optional(
|
|
4803
4936
|
typebox_exports.Number({ description: "\u8FD4\u56DE\u6700\u8FD1N\u4E2A\u4EA4\u6613\u65E5\uFF0C\u9ED8\u8BA4 10" })
|
|
4804
4937
|
)
|
|
@@ -4808,7 +4941,8 @@ var index_default = definePluginEntry({
|
|
|
4808
4941
|
"margin_trading",
|
|
4809
4942
|
params.symbol,
|
|
4810
4943
|
"--days",
|
|
4811
|
-
String(params.days ?? 10)
|
|
4944
|
+
String(params.days ?? 10),
|
|
4945
|
+
...params.include_ratio ? ["--include-ratio"] : []
|
|
4812
4946
|
]);
|
|
4813
4947
|
return asText(out);
|
|
4814
4948
|
}
|
|
@@ -4846,7 +4980,7 @@ var index_default = definePluginEntry({
|
|
|
4846
4980
|
});
|
|
4847
4981
|
api.registerTool({
|
|
4848
4982
|
name: "screen_stocks",
|
|
4849
|
-
description: "\u5168\u5E02\u573A\u80A1\u7968\u7B5B\u9009\uFF08AlphaSift L1 \u591A\u56E0\u5B50\u786C\u7B5B + \u5E02\u573A\u60C5\u7EEA\u8C03\u8282\uFF09\u3002\u6309PE/PB/\u5E02\u503C/\u6362\u624B\u7387/\u6DA8\u8DCC\u5E45/\u91CF\u6BD4\u7B49\u56E0\u5B50\u8FC7\u6EE4\u548C\u8BC4\u5206\uFF0C\u53EF\u7528 l2 \u5F00\u542F\u8D28\u91CF/\u6210\u957F/\u52A8\u91CF/\u6CE2\u52A8\u7387/\u8D44\u91D1\u6D41\u589E\u5F3A",
|
|
4983
|
+
description: "\u5168\u5E02\u573A\u80A1\u7968\u7B5B\u9009\uFF08AlphaSift L1 \u591A\u56E0\u5B50\u786C\u7B5B + \u5E02\u573A\u60C5\u7EEA\u8C03\u8282\uFF09\u3002\u6309PE/PB/\u5E02\u503C/\u6362\u624B\u7387/\u6DA8\u8DCC\u5E45/\u91CF\u6BD4\u7B49\u56E0\u5B50\u8FC7\u6EE4\u548C\u8BC4\u5206\uFF0C\u53EF\u7528 l2 \u5F00\u542F\u8D28\u91CF/\u6210\u957F/\u52A8\u91CF/\u6CE2\u52A8\u7387/\u8D44\u91D1\u6D41\u589E\u5F3A\u3002\u663E\u5F0F\u7B5B\u9009\u6761\u4EF6\u7F3A\u5C11\u6570\u636E\u65F6\u62A5error\uFF0Cfilters_applied\u53EA\u5217\u5B9E\u9645\u6267\u884C\u7684\u6761\u4EF6",
|
|
4850
4984
|
parameters: typebox_exports.Object({
|
|
4851
4985
|
market: typebox_exports.Optional(
|
|
4852
4986
|
typebox_exports.Union(
|
|
@@ -4880,7 +5014,7 @@ var index_default = definePluginEntry({
|
|
|
4880
5014
|
});
|
|
4881
5015
|
api.registerTool({
|
|
4882
5016
|
name: "run_backtest",
|
|
4883
|
-
description: "\u7B56\u7565\u56DE\u6D4B\uFF08AlphaEvo\uFF09\u3002\u8BFB\u53D6YAML\u7B56\u7565\u5B9A\u4E49\uFF0C\u5728\u5386\u53F2\u6570\u636E\u4E0A\u6A21\u62DF\u4EA4\u6613\uFF0C\u8F93\u51FA\u6536\u76CA\u7387/\u56DE\u64A4/\u80DC\u7387\u7B49\u6307\u6807\u3002\u53EA\u60F3\u77E5\u9053\u5355\u4E2A\u6280\u672F\u4FE1\u53F7\u7684\u5386\u53F2\u80DC\u7387\u7528\u66F4\u8F7B\u91CF\u7684 evaluate_signal",
|
|
5017
|
+
description: "\u7B56\u7565\u56DE\u6D4B\uFF08AlphaEvo\uFF09\u3002\u8BFB\u53D6YAML\u7B56\u7565\u5B9A\u4E49\uFF0C\u5728\u5386\u53F2\u6570\u636E\u4E0A\u6A21\u62DF\u4EA4\u6613\uFF0C\u8F93\u51FA\u6536\u76CA\u7387/\u56DE\u64A4/\u80DC\u7387\u7B49\u6307\u6807\u3002\u53EA\u60F3\u77E5\u9053\u5355\u4E2A\u6280\u672F\u4FE1\u53F7\u7684\u5386\u53F2\u80DC\u7387\u7528\u66F4\u8F7B\u91CF\u7684 evaluate_signal\u3002period\u4E3A\u5B9E\u9645\u6570\u636E\u671F\u95F4\uFF0Crequested_period\u4FDD\u7559\u8BF7\u6C42\u671F\u95F4\uFF0Cwarnings\u63D0\u793A\u8986\u76D6\u5DEE\u5F02\uFF1B\u5E74\u5316\u6309\u5B9E\u9645\u671F\u95F4\u8BA1\u7B97",
|
|
4884
5018
|
parameters: typebox_exports.Object({
|
|
4885
5019
|
strategy: typebox_exports.String({ description: "\u7B56\u7565YAML\u6587\u4EF6\u8DEF\u5F84" }),
|
|
4886
5020
|
symbol: typebox_exports.String({ description: "\u80A1\u7968\u4EE3\u7801\uFF08A\u80A1\u5982600519\uFF0C\u7F8E\u80A1\u5982AAPL\uFF0C\u6E2F\u80A1\u598200700.HK\uFF09" }),
|
|
@@ -5154,7 +5288,7 @@ var index_default = definePluginEntry({
|
|
|
5154
5288
|
});
|
|
5155
5289
|
api.registerTool({
|
|
5156
5290
|
name: "screen_risk",
|
|
5157
|
-
description: "A\u80A1\u98CE\u9669\u4E13\u9879\u7B5B\u67E5 \u2014 \u68C0\u67E5\u4F30\u503C\u3001\u6280\u672F\u9884\u8B66\u3001\u89E3\u7981\u3001\u51CF\u6301\u3001\u4E1A\u7EE9\u9884\u8B66\u3001\u76D1\u7BA1\u548C\u884C\u4E1A\u653F\u7B56\uFF0C\u8FD4\u56DE\u98CE\u9669\u8BC4\u7EA7\u548C veto_buy\u3002\u65B0\u95FB\u641C\u7D22\u547D\u4E2D\u662F\u5F85\u6838\u5B9E\u7EBF\u7D22\uFF0C\u4E0D\u662F\u5DF2\u8BC1\u5B9E\u98CE\u9669",
|
|
5291
|
+
description: "A\u80A1\u98CE\u9669\u4E13\u9879\u7B5B\u67E5 \u2014 \u68C0\u67E5\u4F30\u503C\u3001\u6280\u672F\u9884\u8B66\u3001\u89E3\u7981\u3001\u51CF\u6301\u3001\u4E1A\u7EE9\u9884\u8B66\u3001\u76D1\u7BA1\u548C\u884C\u4E1A\u653F\u7B56\uFF0C\u8FD4\u56DE\u98CE\u9669\u8BC4\u7EA7\u548C veto_buy\u3002\u65B0\u95FB\u641C\u7D22\u547D\u4E2D\u662F\u5F85\u6838\u5B9E\u7EBF\u7D22\uFF0C\u4E0D\u662F\u5DF2\u8BC1\u5B9E\u98CE\u9669\u3002data_complete\u548Cwarnings\u6807\u660E\u8986\u76D6\uFF1B\u6570\u636E\u4E0D\u8DB3\u65F6risk_level=unknown\uFF0Crisk_score\u6216veto_buy\u53EF\u4E3Anull\uFF0C\u4E0D\u80FD\u89C6\u4E3A\u4F4E\u98CE\u9669",
|
|
5158
5292
|
parameters: typebox_exports.Object({
|
|
5159
5293
|
symbol: typebox_exports.String({ description: "A\u80A1\u80A1\u7968\u4EE3\u7801\uFF0C\u5982 600519" }),
|
|
5160
5294
|
name: typebox_exports.Optional(
|
|
@@ -5401,7 +5535,7 @@ var index_default = definePluginEntry({
|
|
|
5401
5535
|
});
|
|
5402
5536
|
api.registerTool({
|
|
5403
5537
|
name: "check_alert_rules",
|
|
5404
|
-
description: "\u65E0\u72B6\u6001\u544A\u8B66\u89C4\u5219\u68C0\u67E5 \u2014 \u4F20\u5165\u89C4\u5219\u6570\u7EC4\uFF0C\u8FD4\u56DE\u5F53\u524D\u662F\u5426\u89E6\u53D1\u3002\u89C4\u5219\u7C7B\u578B\uFF1Aprice_below/price_above/change_pct_above/change_pct_below/volume_ratio_above/anomaly/risk_veto/risk_level_at_least\u3002\u4E0D\u505A\u8C03\u5EA6\u4E0D\u5B58\u5386\u53F2",
|
|
5538
|
+
description: "\u65E0\u72B6\u6001\u544A\u8B66\u89C4\u5219\u68C0\u67E5 \u2014 \u4F20\u5165\u89C4\u5219\u6570\u7EC4\uFF0C\u8FD4\u56DE\u5F53\u524D\u662F\u5426\u89E6\u53D1\u3002\u89C4\u5219\u7C7B\u578B\uFF1Aprice_below/price_above/change_pct_above/change_pct_below/volume_ratio_above/anomaly/risk_veto/risk_level_at_least\u3002\u4E0D\u505A\u8C03\u5EA6\u4E0D\u5B58\u5386\u53F2\u3002\u4F9D\u8D56\u6570\u636E\u4E0D\u53EF\u7528\u65F6evaluated\u6761\u76EE\u542Berror\uFF0Cmeta.warnings\u63D0\u793A\u7F3A\u5931\uFF0Ctriggered=false\u4E0D\u4EE3\u8868\u68C0\u67E5\u6210\u529F",
|
|
5405
5539
|
parameters: typebox_exports.Object({
|
|
5406
5540
|
symbol: typebox_exports.String({ description: "\u80A1\u7968\u4EE3\u7801\uFF08A\u80A1\u5982600519\uFF0C\u7F8E\u80A1\u5982AAPL\uFF0C\u6E2F\u80A1\u598200700.HK\uFF09" }),
|
|
5407
5541
|
rules: typebox_exports.Array(
|
|
@@ -5459,7 +5593,7 @@ var index_default = definePluginEntry({
|
|
|
5459
5593
|
});
|
|
5460
5594
|
api.registerTool({
|
|
5461
5595
|
name: "evaluate_signals",
|
|
5462
|
-
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",
|
|
5596
|
+
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\u3002\u5386\u53F2K\u7EBF\u672A\u8986\u76D6\u8BB0\u5F55\u65E5\u65F6skipped_no_data\u5E76\u4FDD\u6301\u672A\u7ED3\u7B97\uFF0C\u4E0D\u80FD\u7528\u8F83\u65B0\u884C\u60C5\u4EE3\u66FF",
|
|
5463
5597
|
parameters: typebox_exports.Object({
|
|
5464
5598
|
symbol: typebox_exports.Optional(
|
|
5465
5599
|
typebox_exports.String({ description: "\u80A1\u7968\u4EE3\u7801\uFF08\u53EF\u9009\uFF0C\u53EA\u8BC4\u4F30\u8BE5\u80A1\u7684\u4FE1\u53F7\uFF09" })
|
package/index.ts
CHANGED
|
@@ -11,8 +11,19 @@ type Executor = (bin: string, argv: string[]) => Promise<string>;
|
|
|
11
11
|
|
|
12
12
|
const defaultExecutor: Executor = async (bin, argv) => {
|
|
13
13
|
const exec = promisify(cp.execFile);
|
|
14
|
-
|
|
15
|
-
|
|
14
|
+
try {
|
|
15
|
+
const { stdout } = await exec(bin, argv, { maxBuffer: 32 * 1024 * 1024 });
|
|
16
|
+
return stdout;
|
|
17
|
+
} catch (error) {
|
|
18
|
+
const stdout = (error as { stdout?: string }).stdout;
|
|
19
|
+
try {
|
|
20
|
+
const data = JSON.parse(stdout ?? "");
|
|
21
|
+
if (data && typeof data.error === "string") return stdout!;
|
|
22
|
+
} catch {
|
|
23
|
+
// A failed subprocess without JSON must not expose stderr or command arguments.
|
|
24
|
+
}
|
|
25
|
+
return JSON.stringify({ error: "Python command failed; check interpreter/dependencies" });
|
|
26
|
+
}
|
|
16
27
|
};
|
|
17
28
|
|
|
18
29
|
let executor: Executor = defaultExecutor;
|
|
@@ -42,6 +53,7 @@ export default definePluginEntry({
|
|
|
42
53
|
register(api) {
|
|
43
54
|
// OpenClaw executes a captured copy of the JS bundle; the venv stays in the installed plugin root.
|
|
44
55
|
const repoRoot = api.rootDir || fallbackRoot;
|
|
56
|
+
const runtimeToolsDir = existsSync(join(repoRoot, "tools")) ? join(repoRoot, "tools") : toolsDir;
|
|
45
57
|
const pythonBin = () => {
|
|
46
58
|
const venvPython = join(repoRoot, venvBin);
|
|
47
59
|
if (existsSync(venvPython)) return venvPython;
|
|
@@ -52,13 +64,141 @@ export default definePluginEntry({
|
|
|
52
64
|
return isWin ? "python" : "python3";
|
|
53
65
|
};
|
|
54
66
|
const runPy = (script: string, args: string[]) =>
|
|
55
|
-
executor(pythonBin(), [join(
|
|
67
|
+
executor(pythonBin(), [join(runtimeToolsDir, script), ...args]);
|
|
56
68
|
// --- Data Tools ---
|
|
57
69
|
|
|
70
|
+
api.registerTool({
|
|
71
|
+
name: "get_announcements",
|
|
72
|
+
description: "查询A股巨潮公告标题、日期、类型和原文PDF链接;按日期范围/类别筛选,默认近90天,top=1..500。第一版不提取正文,truncated提示截断。",
|
|
73
|
+
parameters: Type.Object({
|
|
74
|
+
symbol: Type.String({ description: "A股代码" }),
|
|
75
|
+
category: Type.Optional(Type.Union([Type.Literal("all"), Type.Literal("forecast"), Type.Literal("express"), Type.Literal("annual"), Type.Literal("interim"), Type.Literal("quarterly"), Type.Literal("reduction"), Type.Literal("issuance"), Type.Literal("inquiry"), Type.Literal("dividend")], { description: "公告类别,默认all" })),
|
|
76
|
+
start_date: Type.Optional(Type.String({ description: "开始日期YYYY-MM-DD,默认结束日期前90天" })),
|
|
77
|
+
end_date: Type.Optional(Type.String({ description: "结束日期YYYY-MM-DD,默认今天" })),
|
|
78
|
+
top: Type.Optional(Type.Number({ description: "最多条数1..500,默认50" })),
|
|
79
|
+
}),
|
|
80
|
+
async execute(_id, p) {
|
|
81
|
+
const out = await runPy("value_data.py", ["announcements", p.symbol, "--category", p.category ?? "all", "--start-date", p.start_date ?? "", "--end-date", p.end_date ?? "", "--top", String(p.top ?? 50)]);
|
|
82
|
+
return asText(out);
|
|
83
|
+
},
|
|
84
|
+
});
|
|
85
|
+
|
|
86
|
+
api.registerTool({
|
|
87
|
+
name: "get_us_holdings",
|
|
88
|
+
description: "查询SEC 13F:mode=auto默认有13F申报时查机构,否则按发行人CIK反查持仓机构;manager/issuer可显式指定。发行人通过官方13D/G精确映射CUSIP,扫描最新已发布13F窗口,处理重述/补充修订,返回实际报告期、截止日及映射覆盖。首次约100MB下载,后续缓存;无映射明确报错,不做名称猜测。需SEC_USER_AGENT含真实联系邮箱,不是实时或全部证券持仓。",
|
|
89
|
+
parameters: Type.Object({
|
|
90
|
+
cik: Type.String({ description: "机构或发行人CIK,1..10位数字,如0001067983/0000320193" }),
|
|
91
|
+
mode: Type.Optional(Type.Union([Type.Literal("auto"), Type.Literal("manager"), Type.Literal("issuer")], { description: "默认auto;manager查机构组合,issuer反查发行人持仓机构" })),
|
|
92
|
+
}),
|
|
93
|
+
async execute(_id, p) {
|
|
94
|
+
const out = await runPy("sec_edgar.py", ["holdings", p.cik, ...(p.mode ? ["--mode", p.mode] : [])]);
|
|
95
|
+
return asText(out);
|
|
96
|
+
},
|
|
97
|
+
});
|
|
98
|
+
|
|
99
|
+
api.registerTool({
|
|
100
|
+
name: "get_insider_trades",
|
|
101
|
+
description: "查询美股发行人近期Form 4/4-A内部人交易(SEC官方XML),保留人员职务、交易代码、买卖方向、数量、价格、脚注和衍生品标志。需SEC_USER_AGENT含真实联系邮箱;days按申报日期筛选,top限制文件数,修订勿重复计数。",
|
|
102
|
+
parameters: Type.Object({
|
|
103
|
+
symbol: Type.String({ description: "美股ticker或发行人CIK" }),
|
|
104
|
+
days: Type.Optional(Type.Number({ description: "申报日期窗口1..365天,默认90" })),
|
|
105
|
+
top: Type.Optional(Type.Number({ description: "最多解析Form 4文件数1..20,默认10" })),
|
|
106
|
+
}),
|
|
107
|
+
async execute(_id, p) {
|
|
108
|
+
const out = await runPy("sec_edgar.py", ["insider_trades", p.symbol, "--days", String(p.days ?? 90), "--top", String(p.top ?? 10)]);
|
|
109
|
+
return asText(out);
|
|
110
|
+
},
|
|
111
|
+
});
|
|
112
|
+
|
|
113
|
+
api.registerTool({
|
|
114
|
+
name: "get_valuation_history",
|
|
115
|
+
description: "查询A/HK股票历史PE-TTM/PB、当前正值分位和10/25/50/75/90分位Band,返回实际采样区间;亏损估值分位为null。years=1..10,按天缓存。HK配置LIXINGER_TOKEN时优先理杏仁非金融公司日历史,失败降级百度,不混接来源。",
|
|
116
|
+
parameters: Type.Object({
|
|
117
|
+
symbol: Type.String({ description: "A股代码或港股.HK代码" }),
|
|
118
|
+
years: Type.Optional(Type.Number({ description: "历史窗口年数1..10,默认5" })),
|
|
119
|
+
}),
|
|
120
|
+
async execute(_id, p) {
|
|
121
|
+
const out = await runPy("value_data.py", ["valuation_history", p.symbol, "--years", String(p.years ?? 5)]);
|
|
122
|
+
return asText(out);
|
|
123
|
+
},
|
|
124
|
+
});
|
|
125
|
+
|
|
126
|
+
api.registerTool({
|
|
127
|
+
name: "get_index_valuation",
|
|
128
|
+
description: "查询中国指数估值历史分位与Band;乐咕乐股PE/PB优先,中证官方历史补充滚动PE并保留近期PE1口径。缺PB时可用LIXINGER_TOKEN补充理杏仁mcw历史,来源与算法分别标明,不混接同一指标。",
|
|
129
|
+
parameters: Type.Object({
|
|
130
|
+
symbol: Type.String({ description: "指数代码或名称,如000300、沪深300、000985" }),
|
|
131
|
+
years: Type.Optional(Type.Number({ description: "历史窗口年数1..10,默认5" })),
|
|
132
|
+
}),
|
|
133
|
+
async execute(_id, p) {
|
|
134
|
+
const out = await runPy("value_data.py", ["index_valuation", p.symbol, "--years", String(p.years ?? 5)]);
|
|
135
|
+
return asText(out);
|
|
136
|
+
},
|
|
137
|
+
});
|
|
138
|
+
|
|
139
|
+
api.registerTool({
|
|
140
|
+
name: "get_earnings_calendar",
|
|
141
|
+
description: "查询财报日历:A股report_date必填季度期末,返回预约/修订/实际披露与业绩预告;HK需symbol,优先HKEX已公告业绩审批董事会排期(不是实际披露日),缺失时返回供应商日期。HK可按已知财政期末过滤,未知期次另列。",
|
|
142
|
+
parameters: Type.Object({
|
|
143
|
+
report_date: Type.Optional(Type.String({ description: "A股必填季度期末YYYY-MM-DD;HK可选已公告财政期末,未知期次另列" })),
|
|
144
|
+
symbol: Type.Optional(Type.String({ description: "A股代码可选(省略查全市场);HK必须提供港股.HK代码" })),
|
|
145
|
+
top: Type.Optional(Type.Number({ description: "每类最多返回条数1..500,默认50" })),
|
|
146
|
+
}),
|
|
147
|
+
async execute(_id, p) {
|
|
148
|
+
const out = await runPy("value_data.py", ["earnings_calendar", "--report-date", p.report_date ?? "", "--symbol", p.symbol ?? "", "--top", String(p.top ?? 50)]);
|
|
149
|
+
return asText(out);
|
|
150
|
+
},
|
|
151
|
+
});
|
|
152
|
+
|
|
153
|
+
api.registerTool({
|
|
154
|
+
name: "get_shareholder_structure",
|
|
155
|
+
description: "查询A股股东户数、十大流通股东变化及沪深交易所季度北向合计持股;官方总量优先,十大HKSCC名义持股仅兜底且标明口径。HK返回港交所南向记录。缺失不当零,期末不等于已公布。",
|
|
156
|
+
parameters: Type.Object({
|
|
157
|
+
symbol: Type.String({ description: "A股代码或港股.HK代码" }),
|
|
158
|
+
report_date: Type.Optional(Type.String({ description: "A股报告期YYYY-MM-DD;省略时北向使用最新已公布季度,十大股东使用最新财报期;HK忽略" })),
|
|
159
|
+
}),
|
|
160
|
+
async execute(_id, p) {
|
|
161
|
+
const out = await runPy("value_data.py", ["shareholder_structure", p.symbol, "--report-date", p.report_date ?? ""]);
|
|
162
|
+
return asText(out);
|
|
163
|
+
},
|
|
164
|
+
});
|
|
165
|
+
|
|
166
|
+
api.registerTool({
|
|
167
|
+
name: "get_etf_details",
|
|
168
|
+
description: "查询A股ETF净值折溢价、规模、披露持仓及沪深完整PCF申赎篮子;篮子不是实际持仓。include_full_holdings=true另取最近可得半年度/年度披露股票表,含数量/市值/报告期,非实时全资产组合;benchmark用于跟踪误差。",
|
|
169
|
+
parameters: Type.Object({
|
|
170
|
+
include_full_holdings: Type.Optional(Type.Boolean({ description: "请求半年度/年度披露股票表,默认false" })),
|
|
171
|
+
symbol: Type.String({ description: "A股ETF代码,如510300" }),
|
|
172
|
+
benchmark: Type.Optional(Type.String({ description: "可选基准代码,如sh000300;不猜测基准" })),
|
|
173
|
+
days: Type.Optional(Type.Number({ description: "净值窗口交易日数10..252,默认60" })),
|
|
174
|
+
}),
|
|
175
|
+
async execute(_id, p) {
|
|
176
|
+
const out = await runPy("value_data.py", ["etf_details", p.symbol, "--benchmark", p.benchmark ?? "", "--days", String(p.days ?? 60), ...(p.include_full_holdings ? ["--include-full-holdings"] : [])]);
|
|
177
|
+
return asText(out);
|
|
178
|
+
},
|
|
179
|
+
});
|
|
180
|
+
|
|
181
|
+
api.registerTool({
|
|
182
|
+
name: "get_dividends",
|
|
183
|
+
description: "查询A/HK分红历史、除息日历、已实施TTM股息与连续年数。mode=ranking省略symbol,market=A查报告期排行,market=HK查HKEX/LSEG年度股息率排行(report_date须年末);排行均非当前TTM收益率。缺失不按零。",
|
|
184
|
+
parameters: Type.Object({
|
|
185
|
+
market: Type.Optional(Type.Union([Type.Literal("A"), Type.Literal("HK")], { description: "仅ranking选择市场,默认A" })),
|
|
186
|
+
symbol: Type.Optional(Type.String({ description: "history/calendar必填A股或港股.HK代码;ranking省略" })),
|
|
187
|
+
mode: Type.Optional(Type.Union([Type.Literal("history"), Type.Literal("calendar"), Type.Literal("ranking")], { description: "history默认;calendar未来已公布除息事件;ranking按market查询A/HK排行" })),
|
|
188
|
+
report_date: Type.Optional(Type.String({ description: "ranking报告期YYYY-MM-DD,默认上一年年末;HK仅年度年末日期" })),
|
|
189
|
+
years: Type.Optional(Type.Number({ description: "历史窗口年数1..20,默认10" })),
|
|
190
|
+
top: Type.Optional(Type.Number({ description: "排名条数1..500,默认20" })),
|
|
191
|
+
}),
|
|
192
|
+
async execute(_id, p) {
|
|
193
|
+
const out = await runPy("value_data.py", ["dividends", "--market", p.market ?? "A", "--symbol", p.symbol ?? "", "--mode", p.mode ?? "history", "--report-date", p.report_date ?? "", "--years", String(p.years ?? 10), "--top", String(p.top ?? 20)]);
|
|
194
|
+
return asText(out);
|
|
195
|
+
},
|
|
196
|
+
});
|
|
197
|
+
|
|
58
198
|
api.registerTool({
|
|
59
199
|
name: "get_kline",
|
|
60
200
|
description:
|
|
61
|
-
"获取股票K线数据(OHLCV)。支持A股(如600519)、港股(如00700.HK)、美股(如AAPL)、日股(如7203.T)、韩股(如005930.KS)、台股(如2330.TW)及A股ETF
|
|
201
|
+
"获取股票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",
|
|
62
202
|
parameters: Type.Object({
|
|
63
203
|
symbol: Type.String({
|
|
64
204
|
description: "股票代码,如 600519(A股)、00700.HK(港股)、AAPL(美股)、7203.T(日股)、005930.KS(韩股)、2330.TW(台股)",
|
|
@@ -146,16 +286,18 @@ export default definePluginEntry({
|
|
|
146
286
|
|
|
147
287
|
api.registerTool({
|
|
148
288
|
name: "get_financials",
|
|
149
|
-
description: "
|
|
289
|
+
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",
|
|
150
290
|
parameters: Type.Object({
|
|
151
291
|
symbol: Type.String({ description: "股票代码(A股如600519,美股如AAPL,港股如00700.HK)" }),
|
|
292
|
+
annual: Type.Optional(Type.Boolean({description: "只取年度报告,默认false"})),
|
|
152
293
|
periods: Type.Optional(
|
|
153
|
-
Type.Number({ description: "返回最近N
|
|
294
|
+
Type.Number({ description: "返回最近N个报告期1..40,默认1;annual=true时periods=10请求10年年报" })
|
|
154
295
|
),
|
|
155
296
|
}),
|
|
156
297
|
async execute(_id, params) {
|
|
157
298
|
const args = ["financials", params.symbol];
|
|
158
|
-
if (params.periods && params.periods
|
|
299
|
+
if (params.periods !== undefined && params.periods !== 1) args.push("--periods", String(params.periods));
|
|
300
|
+
if (params.annual) args.push("--annual");
|
|
159
301
|
const out = await runPy("stock_data.py", args);
|
|
160
302
|
return asText(out);
|
|
161
303
|
},
|
|
@@ -290,7 +432,7 @@ export default definePluginEntry({
|
|
|
290
432
|
api.registerTool({
|
|
291
433
|
name: "get_sector_constituents",
|
|
292
434
|
description:
|
|
293
|
-
"查询A股板块成分股(正向映射:板块→股票列表)。板块名支持模糊匹配(如「创新药」自动解析到精确板块名),东财行业/概念 + 新浪多源 failover
|
|
435
|
+
"查询A股板块成分股(正向映射:板块→股票列表)。板块名支持模糊匹配(如「创新药」自动解析到精确板块名),东财行业/概念 + 新浪多源 failover,结果按用户目录缓存7天。仅支持A股;反向查个股所属板块用 resolve_stock_sectors",
|
|
294
436
|
parameters: Type.Object({
|
|
295
437
|
sector: Type.String({ description: "板块名称(可模糊,如 创新药、半导体)" }),
|
|
296
438
|
board_type: Type.Optional(
|
|
@@ -430,9 +572,10 @@ export default definePluginEntry({
|
|
|
430
572
|
api.registerTool({
|
|
431
573
|
name: "get_margin_trading",
|
|
432
574
|
description:
|
|
433
|
-
"获取A股个股融资融券明细(融资余额/融资买入额/融券余量等,上交所/深交所官方数据按交易所分流),返回最近N个交易日序列(最新在前)。金额单位为元,short_*_shares
|
|
575
|
+
"获取A股个股融资融券明细(融资余额/融资买入额/融券余量等,上交所/深交所官方数据按交易所分流),返回最近N个交易日序列(最新在前)。金额单位为元,short_*_shares 单位为股。include_ratio=true追加同日融资买入/成交额百分比(margin_buy_ratio_pct),缺少同日元口径成交额则为null。仅两融标的有数据,非两融标的返回错误",
|
|
434
576
|
parameters: Type.Object({
|
|
435
577
|
symbol: Type.String({ description: "A股股票代码,如 600519" }),
|
|
578
|
+
include_ratio: Type.Optional(Type.Boolean({description: "追加同日融资买入占比,默认false"})),
|
|
436
579
|
days: Type.Optional(
|
|
437
580
|
Type.Number({ description: "返回最近N个交易日,默认 10" })
|
|
438
581
|
),
|
|
@@ -443,6 +586,7 @@ export default definePluginEntry({
|
|
|
443
586
|
params.symbol,
|
|
444
587
|
"--days",
|
|
445
588
|
String(params.days ?? 10),
|
|
589
|
+
...(params.include_ratio ? ["--include-ratio"] : []),
|
|
446
590
|
]);
|
|
447
591
|
return asText(out);
|
|
448
592
|
},
|
|
@@ -488,7 +632,7 @@ export default definePluginEntry({
|
|
|
488
632
|
api.registerTool({
|
|
489
633
|
name: "screen_stocks",
|
|
490
634
|
description:
|
|
491
|
-
"全市场股票筛选(AlphaSift L1 多因子硬筛 + 市场情绪调节)。按PE/PB/市值/换手率/涨跌幅/量比等因子过滤和评分,可用 l2
|
|
635
|
+
"全市场股票筛选(AlphaSift L1 多因子硬筛 + 市场情绪调节)。按PE/PB/市值/换手率/涨跌幅/量比等因子过滤和评分,可用 l2 开启质量/成长/动量/波动率/资金流增强。显式筛选条件缺少数据时报error,filters_applied只列实际执行的条件",
|
|
492
636
|
parameters: Type.Object({
|
|
493
637
|
market: Type.Optional(
|
|
494
638
|
Type.Union(
|
|
@@ -524,7 +668,7 @@ export default definePluginEntry({
|
|
|
524
668
|
api.registerTool({
|
|
525
669
|
name: "run_backtest",
|
|
526
670
|
description:
|
|
527
|
-
"策略回测(AlphaEvo)。读取YAML策略定义,在历史数据上模拟交易,输出收益率/回撤/胜率等指标。只想知道单个技术信号的历史胜率用更轻量的 evaluate_signal",
|
|
671
|
+
"策略回测(AlphaEvo)。读取YAML策略定义,在历史数据上模拟交易,输出收益率/回撤/胜率等指标。只想知道单个技术信号的历史胜率用更轻量的 evaluate_signal。period为实际数据期间,requested_period保留请求期间,warnings提示覆盖差异;年化按实际期间计算",
|
|
528
672
|
parameters: Type.Object({
|
|
529
673
|
strategy: Type.String({ description: "策略YAML文件路径" }),
|
|
530
674
|
symbol: Type.String({ description: "股票代码(A股如600519,美股如AAPL,港股如00700.HK)" }),
|
|
@@ -833,7 +977,7 @@ export default definePluginEntry({
|
|
|
833
977
|
api.registerTool({
|
|
834
978
|
name: "screen_risk",
|
|
835
979
|
description:
|
|
836
|
-
"A股风险专项筛查 — 检查估值、技术预警、解禁、减持、业绩预警、监管和行业政策,返回风险评级和 veto_buy
|
|
980
|
+
"A股风险专项筛查 — 检查估值、技术预警、解禁、减持、业绩预警、监管和行业政策,返回风险评级和 veto_buy。新闻搜索命中是待核实线索,不是已证实风险。data_complete和warnings标明覆盖;数据不足时risk_level=unknown,risk_score或veto_buy可为null,不能视为低风险",
|
|
837
981
|
parameters: Type.Object({
|
|
838
982
|
symbol: Type.String({ description: "A股股票代码,如 600519" }),
|
|
839
983
|
name: Type.Optional(
|
|
@@ -1112,7 +1256,7 @@ export default definePluginEntry({
|
|
|
1112
1256
|
api.registerTool({
|
|
1113
1257
|
name: "check_alert_rules",
|
|
1114
1258
|
description:
|
|
1115
|
-
"无状态告警规则检查 — 传入规则数组,返回当前是否触发。规则类型:price_below/price_above/change_pct_above/change_pct_below/volume_ratio_above/anomaly/risk_veto/risk_level_at_least
|
|
1259
|
+
"无状态告警规则检查 — 传入规则数组,返回当前是否触发。规则类型: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不代表检查成功",
|
|
1116
1260
|
parameters: Type.Object({
|
|
1117
1261
|
symbol: Type.String({ description: "股票代码(A股如600519,美股如AAPL,港股如00700.HK)" }),
|
|
1118
1262
|
rules: Type.Array(
|
|
@@ -1174,7 +1318,7 @@ export default definePluginEntry({
|
|
|
1174
1318
|
api.registerTool({
|
|
1175
1319
|
name: "evaluate_signals",
|
|
1176
1320
|
description:
|
|
1177
|
-
"评估到期信号:拉取记录日之后的日K,判定 target_hit/stop_hit/timeout 并计算收益,回写存储。记录建议用 record_signal,胜率复盘用 get_signal_summary",
|
|
1321
|
+
"评估到期信号:拉取记录日之后的日K,判定 target_hit/stop_hit/timeout 并计算收益,回写存储。记录建议用 record_signal,胜率复盘用 get_signal_summary。历史K线未覆盖记录日时skipped_no_data并保持未结算,不能用较新行情代替",
|
|
1178
1322
|
parameters: Type.Object({
|
|
1179
1323
|
symbol: Type.Optional(
|
|
1180
1324
|
Type.String({ description: "股票代码(可选,只评估该股的信号)" })
|
package/openclaw.plugin.json
CHANGED
|
@@ -54,7 +54,16 @@
|
|
|
54
54
|
"evaluate_signals",
|
|
55
55
|
"get_signal_summary",
|
|
56
56
|
"get_review_history",
|
|
57
|
-
"parse_stock_list"
|
|
57
|
+
"parse_stock_list",
|
|
58
|
+
"get_valuation_history",
|
|
59
|
+
"get_index_valuation",
|
|
60
|
+
"get_earnings_calendar",
|
|
61
|
+
"get_shareholder_structure",
|
|
62
|
+
"get_etf_details",
|
|
63
|
+
"get_dividends",
|
|
64
|
+
"get_announcements",
|
|
65
|
+
"get_us_holdings",
|
|
66
|
+
"get_insider_trades"
|
|
58
67
|
]
|
|
59
68
|
},
|
|
60
69
|
"activation": {
|
package/package.json
CHANGED
|
@@ -48,9 +48,9 @@
|
|
|
48
48
|
"type": "object",
|
|
49
49
|
"description": "风险筛查结果(来自 screen_risk)",
|
|
50
50
|
"properties": {
|
|
51
|
-
"risk_level": { "type": "string", "enum": ["low", "medium", "high"] },
|
|
52
|
-
"risk_score": { "type": "integer", "minimum": 0, "maximum": 100 },
|
|
53
|
-
"veto_buy": { "type": "boolean" },
|
|
51
|
+
"risk_level": { "type": "string", "enum": ["low", "medium", "high", "unknown"] },
|
|
52
|
+
"risk_score": { "type": ["integer", "null"], "minimum": 0, "maximum": 100 },
|
|
53
|
+
"veto_buy": { "type": ["boolean", "null"] },
|
|
54
54
|
"flags": {
|
|
55
55
|
"type": "array",
|
|
56
56
|
"items": {
|