update: flake8
This commit is contained in:
parent
64e314a547
commit
7ee538125e
@ -171,7 +171,7 @@ class OnetokenRestApi(RestClient):
|
|||||||
self.account = account
|
self.account = account
|
||||||
|
|
||||||
self.connect_time = (
|
self.connect_time = (
|
||||||
int(datetime.now().strftime("%y%m%d%H%M%S")) * self.order_count
|
int(datetime.now().strftime("%y%m%d%H%M%S")) * self.order_count
|
||||||
)
|
)
|
||||||
|
|
||||||
self.init(REST_HOST, proxy_host, proxy_port)
|
self.init(REST_HOST, proxy_host, proxy_port)
|
||||||
@ -199,7 +199,7 @@ class OnetokenRestApi(RestClient):
|
|||||||
"""This is for WS Example"""
|
"""This is for WS Example"""
|
||||||
for account_data in data["position"]:
|
for account_data in data["position"]:
|
||||||
_type = account_data['type']
|
_type = account_data['type']
|
||||||
if 'spot' in _type: #统计balance
|
if 'spot' in _type: # 统计balance
|
||||||
account = AccountData(
|
account = AccountData(
|
||||||
accountid=account_data["contract"],
|
accountid=account_data["contract"],
|
||||||
balance=float(account_data["total_amount"]),
|
balance=float(account_data["total_amount"]),
|
||||||
@ -207,7 +207,7 @@ class OnetokenRestApi(RestClient):
|
|||||||
gateway_name=self.gateway_name
|
gateway_name=self.gateway_name
|
||||||
)
|
)
|
||||||
self.gateway.on_account(account)
|
self.gateway.on_account(account)
|
||||||
elif _type == 'future': #期货合约
|
elif _type == 'future': # 期货合约
|
||||||
long_position = PositionData(
|
long_position = PositionData(
|
||||||
symbol=account_data["contract"],
|
symbol=account_data["contract"],
|
||||||
exchange=Exchange.OKEX, # todo add Exchange
|
exchange=Exchange.OKEX, # todo add Exchange
|
||||||
|
Loading…
Reference in New Issue
Block a user