[Fix] bug when receiving empty offset flag

This commit is contained in:
vn.py 2019-07-16 11:19:22 +08:00
parent 07b51393dd
commit c7621cbfa3
3 changed files with 3 additions and 3 deletions

View File

@ -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,

View File

@ -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,

View File

@ -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,