|
12 | 12 | from tigeropen.trade.response import CONTRACT_FIELDS |
13 | 13 |
|
14 | 14 | CONTRACT_FIELD_MAPPINGS = {'secType': 'sec_type', 'localSymbol': 'local_symbol', 'originSymbol': 'origin_symbol', |
15 | | - 'conid': 'contract_id', 'contractId': 'contract_id', 'lastTradingDate': 'expiry', |
| 15 | + 'conid': 'contract_id', 'contractId': 'contract_id', |
16 | 16 | 'shortMargin': 'short_margin', 'shortFeeRate': 'short_fee_rate', |
17 | 17 | 'longInitialMargin': 'long_initial_margin', 'contractMonth': 'contract_month', |
18 | | - 'longMaintenanceMargin': 'long_maintenance_margin'} |
| 18 | + 'longMaintenanceMargin': 'long_maintenance_margin', 'primaryExchange': 'primary_exchange', |
| 19 | + 'tradingClass': 'trading_class', 'lastTradingDate': 'last_trading_date', |
| 20 | + 'minTick': 'min_tick', 'firstNoticeDate': 'first_notice_date', |
| 21 | + 'lastBiddingCloseTime': 'last_bidding_close_time'} |
19 | 22 |
|
20 | 23 |
|
21 | 24 | class ContractsResponse(TigerResponse): |
@@ -62,10 +65,24 @@ def parse_response_content(self, response_content): |
62 | 65 | long_maintenance_margin = contract_fields.get('long_maintenance_margin') |
63 | 66 | contract_month = contract_fields.get('contract_month') |
64 | 67 | identifier = contract_fields.get('identifier') |
| 68 | + primary_exchange = contract_fields.get('primary_exchange') |
| 69 | + market = contract_fields.get('market') |
| 70 | + min_tick = contract_fields.get('min_tick') |
| 71 | + trading_class = contract_fields.get('trading_class') |
| 72 | + status = contract_fields.get('status') |
| 73 | + continuous = contract_fields.get('continuous') |
| 74 | + trade = contract_fields.get('trade') |
| 75 | + last_trading_date = contract_fields.get('last_trading_date') |
| 76 | + first_notice_date = contract_fields.get('first_notice_date') |
| 77 | + last_bidding_close_time = contract_fields.get('last_bidding_close_time') |
65 | 78 | contract = Contract(symbol, currency, contract_id=contract_id, sec_type=sec_type, exchange=exchange, |
66 | 79 | origin_symbol=origin_symbol, local_symbol=local_symbol, expiry=expiry, |
67 | 80 | strike=strike, put_call=put_call, multiplier=multiplier, name=name, |
68 | 81 | short_margin=short_margin, short_fee_rate=short_fee_rate, shortable=shortable, |
69 | 82 | long_initial_margin=long_initial_margin, contract_month=contract_month, |
70 | | - long_maintenance_margin=long_maintenance_margin, identifier=identifier) |
| 83 | + long_maintenance_margin=long_maintenance_margin, identifier=identifier, |
| 84 | + primary_exchange=primary_exchange, market=market, min_tick=min_tick, |
| 85 | + trading_class=trading_class, status=status, continuous=continuous, trade=trade, |
| 86 | + last_trading_date=last_trading_date, first_notice_date=first_notice_date, |
| 87 | + last_bidding_close_time=last_bidding_close_time) |
71 | 88 | self.contracts.append(contract) |
0 commit comments