From 27fab6bfba38b8cf47cb4fb3a21538ceca0a9ab8 Mon Sep 17 00:00:00 2001 From: nanoric Date: Thu, 20 Sep 2018 02:42:54 -0400 Subject: [PATCH] =?UTF-8?q?[Fix]=20=E4=BF=AE=E6=AD=A3=E5=B8=82=E4=BB=B7?= =?UTF-8?q?=E5=8D=95=E6=97=A0=E6=B3=95=E4=B8=8B=E5=8D=95=E7=9A=84=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- vnpy/trader/gateway/bitmexGateway/bitmexGateway.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/vnpy/trader/gateway/bitmexGateway/bitmexGateway.py b/vnpy/trader/gateway/bitmexGateway/bitmexGateway.py index 599ead71..b55c3309 100644 --- a/vnpy/trader/gateway/bitmexGateway/bitmexGateway.py +++ b/vnpy/trader/gateway/bitmexGateway/bitmexGateway.py @@ -196,6 +196,11 @@ class RestApi(BitmexRestApi): 'orderQty': orderReq.volume, 'clOrdID': str(orderId) } + + # 市价单不能有price字段 + if orderReq.priceType == PRICETYPE_MARKETPRICE: + req.pop('price') + self.addReq('POST', '/order', self.onSendOrder, postdict=req) return vtOrderID