Skip to content

Commit 9547011

Browse files
committed
Merge branch 'dev' into 'master'
Dev -> master See merge request !28
2 parents c0172a8 + 66096bc commit 9547011

File tree

3 files changed

+11
-5
lines changed

3 files changed

+11
-5
lines changed

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
setup(
1212
name='tigeropen',
13-
version='1.1.5',
13+
version='1.1.6',
1414
description='TigerBrokers Open API',
1515
packages=find_packages(exclude=[]),
1616
author='TigerBrokers',

tigeropen/common/consts/quote_keys.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,4 +24,4 @@ class QuoteKeyType(Enum):
2424
ALL = None # 所有行情数据
2525
QUOTE = 'askPrice,askSize,bidPrice,bidSize' # 盘口数据
2626
TRADE = 'open,high,low,close,preClose,volume,latestPrice' # 成交数据
27-
TIMELINE = 'mi' # 分钟数据
27+
TIMELINE = 'mi' # 分时数据

tigeropen/push/push_client.py

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,7 @@ def on_error(self, headers, body):
211211
def _get_subscribe_id(counter):
212212
return 'sub-' + str(counter)
213213

214-
def subscribe_asset(self):
214+
def subscribe_asset(self, account=None):
215215
"""
216216
订阅账户资产更新
217217
:return:
@@ -222,6 +222,8 @@ def subscribe_asset(self):
222222
headers['destination'] = 'trade/asset'
223223
headers['subscription'] = 'Asset'
224224
headers['id'] = sub_id
225+
if account:
226+
headers['account'] = account
225227

226228
self._stomp_connection.subscribe('trade/asset', id=sub_id, headers=headers)
227229
return sub_id
@@ -238,7 +240,7 @@ def unsubscribe_asset(self, id=None):
238240
headers['id'] = sub_id
239241
self._stomp_connection.unsubscribe(id=sub_id, headers=headers)
240242

241-
def subscribe_position(self):
243+
def subscribe_position(self, account=None):
242244
"""
243245
订阅账户持仓更新
244246
:return:
@@ -249,6 +251,8 @@ def subscribe_position(self):
249251
headers['destination'] = 'trade/position'
250252
headers['subscription'] = 'Position'
251253
headers['id'] = sub_id
254+
if account:
255+
headers['account'] = account
252256

253257
self._stomp_connection.subscribe('trade/position', id=sub_id, headers=headers)
254258
return sub_id
@@ -266,7 +270,7 @@ def unsubscribe_position(self, id=None):
266270

267271
self._stomp_connection.unsubscribe(id=sub_id, headers=headers)
268272

269-
def subscribe_order(self):
273+
def subscribe_order(self, account=None):
270274
"""
271275
订阅账户订单更新
272276
:return:
@@ -277,6 +281,8 @@ def subscribe_order(self):
277281
headers['destination'] = 'trade/order'
278282
headers['subscription'] = 'OrderStatus'
279283
headers['id'] = sub_id
284+
if account:
285+
headers['account'] = account
280286

281287
self._stomp_connection.subscribe('trade/order', id=sub_id, headers=headers)
282288
return sub_id

0 commit comments

Comments
 (0)