Files
Hermes-Skills/okx-auto-position/references/channel-prompts-template.md
T
mike 657dc41c46 Initial commit: Trading skills collection
- OKX交易自动化 (okx-auto-position, okx-crypto, okx-exchange)
- 交易信号处理 (signal-confirmation-templates, trading-signal-aggregator)
- 量化因子挖掘 (quant-factor-mining)
- 长桥集成 (longbridge-cli, longbridge-python-sdk)
- 六合彩分析 (lottery-hk)
- 股息投资 (dividend-investing, dividend-scanner)
- 日内交易 (intraday-trading)
- 同花顺 (tonghuashun)
2026-07-05 02:39:41 -04:00

64 lines
3.1 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# TG信号群 Channel Prompts 配置
## 当前配置(2026-07-04 命令版)
config.yaml 中的 channel_prompts **必须给出具体可执行命令**,不能只说"加载skill"
```yaml
telegram:
channel_prompts:
'-1003966251111': '交易信号处理规则(必须严格执行): 收到含【币种】的消息后,第一步:用terminal工具执行python3 ~/.hermes/skills/trading/okx-auto-position/scripts/format_signal.py --symbol {从【币种】提取} --side {做多=long/做空=short} --leverage {从【杠杆】提取数字} --trader {从第一行【】提取名字} --trader-pos {从【仓位大小】提取} --trader-value {从【仓位价值】提取} --trader-entry {从【开仓价】提取} --trader-pnl {从【未实现盈亏】提取} --signal-type C。第二步:用terminal工具执行bash ~/.hermes/scripts/push_to_qq.sh {脚本输出}。禁止自己编排版模板,必须用脚本输出。非交易消息忽略。'
```
### ⚠️ 极简版channel_prompts"加载skill按流程处理")实测失败
**教训(2026-07-04**agent不会主动加载skill。写"加载skill okx-auto-position按流程处理"时,agent无视指令,继续用硬编码模板推送错误金额。
**根因**
- mimo-v2.5-pro模型不会执行模糊指令
- ongoing session重启后保留旧的"行为记忆"
- channel_prompts的指令被旧上下文覆盖
**解决**channel_prompts里写完整命令,agent只需用terminal工具执行,不需要"理解"skill。
所有流程细节在 `okx-auto-position` skill 的 SKILL.md 里维护。改流程只改skill,不碰config.yaml,不需要重启gateway。
## 历史教训
旧版config.yaml把完整流程指令写在channel_prompts里(6步详细指令),导致:
1. 每次改流程都要重启gateway
2. config.yaml越写越长,难以维护
3. skill和config里的指令重复甚至冲突
极简版解决了这些问题:channel_prompts只做路由(指向skill),skill做所有逻辑。
## 关键规则
1. **不要回复群** — 所有回复只在QQ私信推送
2. **不要做分析** — 不在主群做趋势复盘
3. **非交易消息忽略** — 广告、闲聊直接跳过
4. **推送目标** — QQ DM: `qqbot:B1EF50442496D57C1B4F3890501C34C2`
## ⚠️ 改了channel_prompts后必须删旧session
**问题**ongoing session不会自动加载新的channel_prompts。改了配置后agent行为不变。
**解决**:删除TG群的旧sessiongateway自动重建。
```bash
# 查找TG群session
sqlite3 ~/.hermes/state.db "SELECT id, chat_id, title FROM sessions WHERE chat_id LIKE '%1003966251111%';"
# 删除(让gateway重建)
sqlite3 ~/.hermes/state.db "DELETE FROM sessions WHERE id = 'xxx';"
```
**同理**:改了skill后如果TG agent行为没变,也可能是旧session缓存了旧skill内容。删session重建即可。
## 修正已有信号金额
当agent推送了硬编码模板(金额错误)时,可用fix_recommendation.py修正:
```bash
python3 ~/.hermes/skills/trading/okx-auto-position/scripts/fix_recommendation.py '原始信号文本'
```
自动提取币种/方向/杠杆,调advisor获取正确金额,输出含📐的修正消息。可直接push_to_qq.sh推送。