auto_trade_sys/.cursorrules
薇薇安 0c489bfdee a
2026-01-23 14:59:57 +08:00

14 lines
898 B
Plaintext
Raw Permalink 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.

# 交易系统开发最高准则
## 1. 风险控制(核心)
- **止损高于一切**:严禁在任何平仓逻辑前添加时间限制。任何情况下,只要触发止损条件,必须立即执行平仓。
- **严禁恢复时间锁**:绝对不允许重新启用 `MIN_HOLD_TIME_SEC` 来限制止损或止盈。
- **异常处理**:所有涉及 `binance.create_order` 的操作必须包含 try-catch 逻辑,并有重试机制或错误预警。
## 2. 币安合约逻辑
- **挂单确认**:在开仓订单成交后,必须立即调用 `_ensure_exchange_sltp_orders` 在交易所侧挂好止损单。
- **价格类型**:区分 Mark Price标记价格和 Last Price最新价格止损逻辑应优先参考标记价格以防插针。
## 3. 代码风格
- 使用 Python 异步编程 (asyncio)。
- 所有的交易日志必须记录 Symbol、价格、原因和时间戳。