---
name: php186-skill-73792
description: "REQUIRED architecture skill. Hermes orchestrates USDT-M trading: run context → you (MiMo) write analysis with USDT sizing → place/close via CLI. Never say trading_engine calls the LLM itself."
---

# Hermes合约交易周期

## Hermes 合约交易周期（大脑在 Hermes）

 

## 架构硬规则

 

1. **你（Hermes / MiMo）负责分析与决策**
2. **` trading_engine ` 只提供工具命令**（账户、信号、扫描、下单、平仓）
3. **不要**假设引擎会自己调 MiMo；` TE_LLM_ANALYSIS=0 `、` TE_AUTO_EXEC=0 `
4. 信号/扫描只会写入 ` pending `，等你 ` place `

 

## 标准流程（自动或用户问「帮我看看要不要开」）

 

### 1) 取上下文

 

```
cd /home/ubuntu/trading_engine && python3 run.py context
```

 

必要时再单独：

 

```
python3 run.py account
python3 run.py signals
python3 run.py scan
python3 run.py pending
```

 

### 2) 你来写分析

 

用中文输出完整计划，必须含：

 

- 当前权益 / 持仓
- 方向、入场、止损、止盈
- **杠杆、保证金 USDT、名义 USDT、止损预计亏损 USDT**
- 是否开仓（approve / reject）

 

### 3) 批准则下单

 

把计划写成 JSON 文件后：

 

```
cd /home/ubuntu/trading_engine && python3 run.py place --file /tmp/hermes_plan.json
```

 

或批准某个 pending：

 

```
cd /home/ubuntu/trading_engine && python3 run.py place --pending-id <id>
```

 

### 4) 平仓

 

```
cd /home/ubuntu/trading_engine && python3 run.py close --symbol BTCUSDT
```

 

## place JSON 示例

 

```
{
  "symbol": "BTCUSDT",
  "side": "SHORT",
  "leverage": 5,
  "margin_usdt": 400,
  "entries": [
    {"tag": "near", "price": 63900, "qty_pct": 0.65},
    {"tag": "far", "price": 63400, "qty_pct": 0.35}
  ],
  "sl": 64500,
  "tp": [
    {"price": 62900, "pct": 0.5, "move_sl_to_be": true},
    {"price": 62200, "pct": 0.5, "move_sl_to_be": false}
  ],
  "thesis": "你的完整中文分析",
  "source": "hermes"
}
```

 

## 定时建议

 

每 10–15 分钟跑一轮：` context ` → 分析 → 有机会则 ` place `；持仓管理仍可由 ` manage ` / 主循环机械执行止盈止损。
