Skip to content

Commit 29be339

Browse files
committed
contract lot size
1 parent 12bcf77 commit 29be339

4 files changed

Lines changed: 6 additions & 5 deletions

File tree

tigeropen/quote/quote_client.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1047,18 +1047,18 @@ def get_future_contract(self, contract_code, lang=None):
10471047
raise ApiException(response.code, response.message)
10481048
return None
10491049

1050-
def get_future_continuous_contracts(self, type_=None, lang=None):
1050+
def get_future_continuous_contracts(self, future_type=None, lang=None):
10511051
"""
10521052
Get Future Continuous Contracts
1053-
:param type_: 'CL'
1053+
:param future_type: 'CL'
10541054
:param lang: zh_CN,zh_TW,en_US
10551055
:return: pandas.DataFrame
10561056
contract_code continuous contract_month currency display_multiplier exchange exchange_code first_notice_date last_bidding_close_time last_trading_date min_tick multiplier name symbol trade type
10571057
0 CLmain False USD 1 NYMEX NYMEX 0 0.01 1000.0 WTI原油主连 CL True CL
10581058
10591059
"""
10601060
params = FutureContractParams()
1061-
params.type = type_
1061+
params.type = future_type
10621062
params.lang = get_enum_value(lang) if lang else get_enum_value(self._lang)
10631063

10641064
request = OpenApiRequest(FUTURE_CONTINUOUS_CONTRACTS, biz_model=params)

tigeropen/tiger_open_config.py

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

5656
DEFAULT_PROPS_FILE = 'tiger_openapi_config.properties'
5757
DEFAULT_TOKEN_FILE = 'tiger_openapi_token.properties'
58-
TOKEN_REFRESH_DURATION = 24 * 60 * 60 # seconds
58+
TOKEN_REFRESH_DURATION = 0 # seconds
5959
TOKEN_CHECK_INTERVAL = 5 * 60 # seconds
6060

6161
def fallback_get_mac_address():

tigeropen/trade/domain/contract.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,7 @@ def __init__(self, symbol=None, currency=None, contract_id=None, sec_type=None,
8989
self.discounted_start_at = kwargs.get('discounted_start_at')
9090
self.discounted_end_at = kwargs.get('discounted_end_at')
9191
self.categories = kwargs.get('categories')
92+
self.lot_size = kwargs.get('lot_size')
9293

9394
@property
9495
def right(self):

tigeropen/trade/response/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,5 @@
1010
'shortable', 'long_initial_margin', 'long_maintenance_margin', 'contract_month', 'identifier',
1111
'primary_exchange', 'min_tick', 'trading_class', 'continuous', 'trade', 'tradeable',
1212
'last_trading_date', 'first_notice_date', 'last_bidding_close_time', 'shortable_count',
13-
'categories'])
13+
'categories', 'is_etf', 'etf_leverage', 'lot_size'])
1414

0 commit comments

Comments
 (0)