Skip to content

Commit f280c70

Browse files
committed
mod aggregate asset field
1 parent 91cadec commit f280c70

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

tigeropen/trade/domain/prime_account.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,8 @@ def __init__(self):
125125
self.intraday_risk_ratio = float('inf')
126126
# 总市值
127127
self.gross_position_value = float('inf')
128+
# 股票持仓市值
129+
self.stock_market_value = float('inf')
128130
# 期权市值
129131
self.option_market_value = float('inf')
130132
# 期货市值

tigeropen/trade/trade_client.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@
66
"""
77
import logging
88

9-
from tigeropen.common.consts import THREAD_LOCAL, SecurityType, Market, Currency, Language, OPEN_API_SERVICE_VERSION_V3
9+
from tigeropen.common.consts import THREAD_LOCAL, SecurityType, Market, Currency, Language, OPEN_API_SERVICE_VERSION_V3, \
10+
SegmentType
1011
from tigeropen.common.consts.service_types import CONTRACTS, ACCOUNTS, POSITIONS, ASSETS, ORDERS, ORDER_NO, \
1112
CANCEL_ORDER, MODIFY_ORDER, PLACE_ORDER, ACTIVE_ORDERS, INACTIVE_ORDERS, FILLED_ORDERS, CONTRACT, PREVIEW_ORDER, \
1213
PRIME_ASSETS, ORDER_TRANSACTIONS, QUOTE_CONTRACT, ANALYTICS_ASSET, SEGMENT_FUND_AVAILABLE, SEGMENT_FUND_HISTORY, \
@@ -318,7 +319,7 @@ def get_prime_assets(self, account=None, base_currency=None, consolidated=True):
318319
raise ApiException(response.code, response.message)
319320
return None
320321

321-
def get_aggregate_assets(self, account=None, base_currency=None, seg_type=None):
322+
def get_aggregate_assets(self, account=None, seg_type=SegmentType.SEC, base_currency=None):
322323
params = AggregateAssetParams()
323324
params.account = account if account else self._account
324325
params.secret_key = self._secret_key
@@ -331,7 +332,7 @@ def get_aggregate_assets(self, account=None, base_currency=None, seg_type=None):
331332
response = AggregateAssetsResponse()
332333
response.parse_response_content(response_content)
333334
if response.is_success():
334-
return response.data
335+
return response.result
335336
else:
336337
raise ApiException(response.code, response.message)
337338

0 commit comments

Comments
 (0)