diff --git a/vnpy/trader/gateway/ctpGateway/ctpGateway.py b/vnpy/trader/gateway/ctpGateway/ctpGateway.py index f8364a1e..d6cfff21 100644 --- a/vnpy/trader/gateway/ctpGateway/ctpGateway.py +++ b/vnpy/trader/gateway/ctpGateway/ctpGateway.py @@ -734,6 +734,8 @@ class CtpTdApi(TdApi): pos.ydPosition = data['Position'] - data['TodayPosition'] # 计算成本 + if pos.symbol not in self.symbolSizeDict: + return size = self.symbolSizeDict[pos.symbol] cost = pos.price * pos.position * size