diff --git a/vnpy/gateway/ctp/ctp_gateway.py b/vnpy/gateway/ctp/ctp_gateway.py index a4aa22f9..dacad210 100644 --- a/vnpy/gateway/ctp/ctp_gateway.py +++ b/vnpy/gateway/ctp/ctp_gateway.py @@ -447,7 +447,7 @@ class CtpTdApi(TdApi): exchange=exchange, orderid=orderid, direction=DIRECTION_CTP2VT[data["Direction"]], - offset=OFFSET_CTP2VT[data["CombOffsetFlag"]], + offset=OFFSET_CTP2VT.get(data["CombOffsetFlag"], Offset.NONE), price=data["LimitPrice"], volume=data["VolumeTotalOriginal"], status=Status.REJECTED, diff --git a/vnpy/gateway/ctptest/ctptest_gateway.py b/vnpy/gateway/ctptest/ctptest_gateway.py index 3b6bb51d..22aee478 100644 --- a/vnpy/gateway/ctptest/ctptest_gateway.py +++ b/vnpy/gateway/ctptest/ctptest_gateway.py @@ -446,7 +446,7 @@ class CtpTdApi(TdApi): exchange=exchange, orderid=orderid, direction=DIRECTION_CTP2VT[data["Direction"]], - offset=OFFSET_CTP2VT[data["CombOffsetFlag"]], + offset=OFFSET_CTP2VT.get(data["CombOffsetFlag"], Offset.NONE), price=data["LimitPrice"], volume=data["VolumeTotalOriginal"], status=Status.REJECTED, diff --git a/vnpy/gateway/mini/mini_gateway.py b/vnpy/gateway/mini/mini_gateway.py index c616be4d..ee1591bc 100644 --- a/vnpy/gateway/mini/mini_gateway.py +++ b/vnpy/gateway/mini/mini_gateway.py @@ -443,7 +443,7 @@ class MiniTdApi(TdApi): exchange=exchange, orderid=orderid, direction=DIRECTION_MINI2VT[data["Direction"]], - offset=OFFSET_MINI2VT[data["CombOffsetFlag"]], + offset=OFFSET_MINI2VT.get(data["CombOffsetFlag"], Offset.NONE), price=data["LimitPrice"], volume=data["VolumeTotalOriginal"], status=Status.REJECTED,