From 694317b663d3fba86d7631cdeed18fe9ce132e36 Mon Sep 17 00:00:00 2001 From: nanoric Date: Thu, 11 Oct 2018 05:50:26 -0400 Subject: [PATCH] =?UTF-8?q?[Mod]=20=E4=BF=AE=E6=94=B9order=E7=9A=84?= =?UTF-8?q?=E5=AD=97=E6=AE=B5=E8=8E=B7=E5=8F=96=E9=A1=BA=E5=BA=8F=EF=BC=9A?= =?UTF-8?q?=E6=8C=89=E5=AD=97=E6=AF=8D=E9=A1=BA=E5=BA=8F=E6=8E=92=E5=88=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- vnpy/api/okexfuture/OkexFutureApi.py | 28 +++++++++++++++------------- 1 file changed, 15 insertions(+), 13 deletions(-) diff --git a/vnpy/api/okexfuture/OkexFutureApi.py b/vnpy/api/okexfuture/OkexFutureApi.py index 4ac26f0d..78a3a796 100644 --- a/vnpy/api/okexfuture/OkexFutureApi.py +++ b/vnpy/api/okexfuture/OkexFutureApi.py @@ -44,18 +44,19 @@ class OkexFutureOrderType(Enum): class OkexFutureOrder(object): def __init__(self): - self.symbol = None self.volume = None + self.contractName = None + self.createDate = None + self.tradedVolume = None + self.fee = None + self.leverRate = None + self.remoteId = None self.price = None self.priceAvg = None self.status = None + self.symbol = None self.orderType = None self.unitAmount = None - self.leverRate = None - self.remoteId = None - self.fee = None - self.tradedVolume = None - self.createDate = None class OkexFutureUserInfo(object): @@ -271,19 +272,20 @@ class OkexFutureRestClient(OkexFutureRestBase): if success: order = data['orders'][0] okexOrder = OkexFutureOrder() - - okexOrder.symbol = order['symbol'] + okexOrder.volume = order['amount'] + okexOrder.contractName = order['contract_name'] + okexOrder.createDate = order['create_date'] + okexOrder.tradedVolume = order['deal_amount'] + okexOrder.fee = order['fee'] + okexOrder.leverRate = order['lever_rate'] + okexOrder.remoteId = order['order_id'] okexOrder.price = order['price'] okexOrder.priceAvg = order['price_avg'] okexOrder.status = order['status'] okexOrder.orderType = order['type'] okexOrder.unitAmount = order['unit_amount'] - okexOrder.leverRate = order['lever_rate'] - okexOrder.remoteId = order['order_id'] - okexOrder.fee = order['fee'] - okexOrder.tradedVolume = order['deal_amount'] - okexOrder.createDate = order['create_date'] + okexOrder.symbol = order['symbol'] extra.onSuccess(okexOrder, extra.extra) else: