@dshtrading/kit-hk 0.1.1 → 0.1.3

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.
@@ -216,3 +216,15 @@ export interface IndicatorDefinition {
216
216
  ```
217
217
 
218
218
  若工具返回 `Validation failed`,请根据返回的具体报错信息调整代码(如修复长度不对齐、NaN 防护等)后重新尝试,直至落库成功。
219
+
220
+ ### 4.1 创作即上图(可选一步到位)
221
+
222
+ `indicator_author` 支持可选参数 `activate`(布尔,默认 false):置 true 时指标通过校验落库后会立即按 schema 默认参数挂上用户当前图表(GUI 经 SSE 即时点亮),无需再调 `indicator_activate`。适合「帮我写个 XXX 并加到图上」这类一句话需求;仅落库不上图的需求保持缺省。
223
+
224
+ ### 4.2 图表挂载管理(indicator_list / indicator_activate / indicator_deactivate)
225
+
226
+ - `indicator_list`:枚举全部可用指标——预置与自定义(id/title/pane/参数 schema/描述)及当前激活名册(含生效参数)。创作前查重、挂载前选 id 与参数时先调它。
227
+ - `indicator_activate`:把指标挂上用户图表。`id` 必须是预置或已创作落库的自定义指标;可选 `paramsJson`(JSON 对象,如 `{"period":14}`)覆写参数默认值,越界自动收敛到 min/max,缺失键取默认值。重复挂载同 id 即更新参数(每 id 至多一个实例)。
228
+ - `indicator_deactivate`:从图上摘除一个实例(定义仍在指标库);彻底删除自定义指标定义用 `indicator_delete`。
229
+
230
+ 典型链路:`indicator_list` 查重 → `indicator_author`(或带 `activate: true` 一步上图)→ 需要调参时 `indicator_activate` + `paramsJson` → `indicator_deactivate` 摘除。
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@dshtrading/kit-hk",
3
3
  "description": "Hong Kong market toolkit plugin for dsh-trading: HK risk checklist skill provider and HK fast-news (degraded) / fundamentals tools; runs as an hk-trader preset row (session-scoped)",
4
- "version": "0.1.1",
4
+ "version": "0.1.3",
5
5
  "type": "module",
6
6
  "main": "lib/index.js",
7
7
  "types": "./lib/index.d.ts",
@@ -18,8 +18,8 @@
18
18
  ],
19
19
  "license": "PolyForm-Noncommercial-1.0.0",
20
20
  "dependencies": {
21
- "@dshtrading/indicators": "0.1.1",
22
- "@dshtrading/knowledge": "0.1.1"
21
+ "@dshtrading/indicators": "0.1.3",
22
+ "@dshtrading/knowledge": "0.1.3"
23
23
  },
24
24
  "peerDependencies": {
25
25
  "@deepseek-ai/cordis": ">=4.0.0",
@@ -30,7 +30,7 @@
30
30
  "devDependencies": {
31
31
  "tsdown": "^0.22.0",
32
32
  "vitest": "^3.0.0",
33
- "@dshtrading/api": "0.1.1"
33
+ "@dshtrading/api": "0.1.3"
34
34
  },
35
35
  "scripts": {
36
36
  "build": "tsdown",