openclaw-glance-plugin 0.1.30 → 0.1.31
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/package.json
CHANGED
|
@@ -25,6 +25,44 @@
|
|
|
25
25
|
- `channels`(至少 1 个渠道;是否包含 `openclaw` 见下方渠道规则)
|
|
26
26
|
- `channel_configs`
|
|
27
27
|
|
|
28
|
+
### operator_parameters 填写说明
|
|
29
|
+
|
|
30
|
+
字段定义:
|
|
31
|
+
- `operator_parameters.condition`:触发条件表达式(字符串,必填)
|
|
32
|
+
- `operator_parameters.variables`:条件表达式里引用的变量(对象,建议必填)
|
|
33
|
+
- `operator_parameters.message_template`:触发提示文案模板(字符串,建议填写)
|
|
34
|
+
- `operator_parameters.symbols`:多标的策略的别名映射(对象,可选)
|
|
35
|
+
|
|
36
|
+
表达式支持:
|
|
37
|
+
- 比较:`<`, `<=`, `>`, `>=`, `==`, `!=`
|
|
38
|
+
- 逻辑:`and`, `or`
|
|
39
|
+
- 可用行情字段:`price`, `volume`, `change_percent`
|
|
40
|
+
- A股/港股额外可用:`turnover_rate`
|
|
41
|
+
- `crypto` 不要使用 `turnover_rate`
|
|
42
|
+
|
|
43
|
+
字段含义(其中 `volume` / `change_percent` / `turnover_rate` 都是日内指标):
|
|
44
|
+
- `price`:最新成交价。
|
|
45
|
+
- `volume`:当日累计成交量(日内)。
|
|
46
|
+
- `change_percent`:当日涨跌幅(日内,小数表示;如 2% 写 `0.02`,-2% 写 `-0.02`)。
|
|
47
|
+
- `turnover_rate`:当日换手率(日内,小数表示;如 1% 写 `0.01`,仅 A股/港股可用)。
|
|
48
|
+
|
|
49
|
+
填写规则(创建策略时直接套用):
|
|
50
|
+
- `condition` 只引用“行情字段 + variables 里的变量名”,不要写未定义变量。
|
|
51
|
+
- `variables` 键名必须和 `condition` 中引用一致(如 `threshold/tr_threshold/cp_threshold`)。
|
|
52
|
+
- `message_template` 推荐复用 `variables` 里的键位占位:`{product_name} ... {threshold}`。
|
|
53
|
+
- 文案优先放在 `message_template`,渠道内 `content/condition` 仅在用户明确要求时再覆盖。
|
|
54
|
+
|
|
55
|
+
常用模板(按市场):
|
|
56
|
+
- A股/港股个股:
|
|
57
|
+
`condition: "price >= threshold and turnover_rate >= tr_threshold"`
|
|
58
|
+
`variables: { "threshold": 12.5, "tr_threshold": 0.01, "product_name": "平安银行" }`
|
|
59
|
+
- 指数:
|
|
60
|
+
`condition: "price <= threshold"`
|
|
61
|
+
`variables: { "threshold": 3500, "product_name": "沪深300" }`
|
|
62
|
+
- 加密:
|
|
63
|
+
`condition: "price >= threshold and change_percent >= cp_threshold"`
|
|
64
|
+
`variables: { "threshold": 70000, "cp_threshold": 0.02, "product_name": "Bitcoin" }`
|
|
65
|
+
|
|
28
66
|
渠道规则:
|
|
29
67
|
- 用户明确“仅/只用某几个渠道”时:严格按用户指定,可不含 `openclaw`。
|
|
30
68
|
- 用户只说“用某个渠道/某几个渠道”但未强调“仅限”时:默认补 `openclaw`。
|
|
@@ -52,7 +90,8 @@ OpenClaw 路由约束(当 `channels` 包含 `openclaw`):
|
|
|
52
90
|
variables: {
|
|
53
91
|
cp_threshold: -0.02,
|
|
54
92
|
product_name: '比特币'
|
|
55
|
-
}
|
|
93
|
+
},
|
|
94
|
+
message_template: '{product_name} 跌幅达到 {cp_threshold},当前价格 {price}'
|
|
56
95
|
},
|
|
57
96
|
channels: ['openclaw', 'dingtalk', 'sms'],
|
|
58
97
|
channel_configs: {
|
|
@@ -155,9 +194,10 @@ rg -n '^sms,jinguo\.xie,' ~/.openclaw/workspace/memory/watch-notify-contacts.csv
|
|
|
155
194
|
1. 字段名使用 snake_case:`product_code/product_type/operator_type/operator_parameters/channels/channel_configs`
|
|
156
195
|
2. `operator_type` 固定为 `rule`
|
|
157
196
|
3. `operator_parameters.condition` 与 `operator_parameters.variables` 同时存在
|
|
158
|
-
4. `
|
|
159
|
-
5.
|
|
160
|
-
6.
|
|
197
|
+
4. `message_template` 建议填写,且占位符与变量名一致
|
|
198
|
+
5. `channels` 至少一个,且与 `channel_configs` 对应
|
|
199
|
+
6. 渠道配置必须是对象,不能是 JSON 字符串
|
|
200
|
+
7. 不手动传 `request_id`
|
|
161
201
|
|
|
162
202
|
## 4. 买卖意图与条件方向
|
|
163
203
|
|