From 1053eb2d239b9d5480f939b17a7bb3c7947b6e84 Mon Sep 17 00:00:00 2001 From: "vn.py" Date: Tue, 17 Sep 2019 22:56:40 +0800 Subject: [PATCH] [Mod] close #1938 --- vnpy/gateway/ctp/ctp_gateway.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/vnpy/gateway/ctp/ctp_gateway.py b/vnpy/gateway/ctp/ctp_gateway.py index d08f3864..a72f4598 100644 --- a/vnpy/gateway/ctp/ctp_gateway.py +++ b/vnpy/gateway/ctp/ctp_gateway.py @@ -717,6 +717,10 @@ class CtpTdApi(TdApi): """ self.order_ref += 1 + if req.offset not in OFFSET_VT2CTP: + self.gateway.write_log("请选择开平方向") + return "" + ctp_req = { "InstrumentID": req.symbol, "ExchangeID": req.exchange.value,