Use CTP PositionDate from investor position query for SHFE close offset.
Parse official today/history legs in onRspQryInvestorPosition instead of guessing or retrying alternate offsets. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
+1
-1
@@ -119,7 +119,7 @@ CTP_LIVE_ENV=实盘
|
||||
|--------|------|
|
||||
| **大商所(DCE)** 等 | 使用通用 **CLOSE** |
|
||||
| **上期所(SHFE)、能源(INE)、郑商所(CZCE)、中金所(CFFEX)** | 区分 **平今 CLOSETODAY** / **平昨 CLOSEYESTERDAY** |
|
||||
| 选择依据 | 查询持仓的今仓 `td_volume`、昨仓 `yd_volume`,优先平今再平昨 |
|
||||
| 选择依据 | CTP `OnRspQryInvestorPosition` 的 **PositionDate**(1=今仓、2=昨仓);上期所今昨为**两条独立回报**,与同花顺/快期一致 |
|
||||
|
||||
这与国内期货公司 CTP 客户端、快期等 **标准投机平仓逻辑** 一致。
|
||||
|
||||
|
||||
Reference in New Issue
Block a user