[QMT]05-Get basic market information

Function: get contract basic information

get_instrument_detail(stock_code)

1

  • paraphrase

  • Get contract basic information

  • parameter

  • stock_code - string contract code

  • Return dict data dictionary, { field1 : value1, field2 : value2, ... }, return None if the specified contract cannot be found

ExchangeID - string contract market code
InstrumentID - string contract code
InstrumentName - string contract name
ProductID - string contract product ID (futures)
ProductName - string contract product name (futures)
CreateDate - str listing date (futures)
OpenDate - str IPO date ( Stock)
ExpireDate - int delisting date or expiration date
PreClose - float previous closing price
SettlementPrice - float previous settlement price
UpStopPrice - float current day limit price
DownStopPrice - float current day limit price
FloatVolume - float tradable share capital
TotalVolume - float total share capital
LongMarginRatio - float long position Margin rate
ShortMarginRatio - float short margin rate
PriceTick - float minimum price change unit
VolumeMultiple - int contract multiplier (for varieties other than futures, the default is 1)
MainContract - int Main contract mark, 1, 2, 3 respectively represent the first main contract, second main contract, third main contract
LastVolume - int Yesterday's open interest
InstrumentStatus - int The date that the contract has been suspended (the value of the first day of suspension is 0, The next day is 1, and so on. Note that the value of normal trading stocks is also 0) To get the stock suspension status, refer to get_full_tick openInt field
IsTrading - bool whether the contract is tradable
IsRecent - bool whether it is a near-month contract
  • Remark

  • Can be used to check whether the contract code is correct

Example: Take Ping An Bank as an example to demonstrate how to call

from xtquant import xtdata
print(xtdata.get_instrument_detail('000001.SZ'))

output

{'ExchangeID': 'SZ', 'InstrumentID': '000001', 'InstrumentName': '平安银行', 'ProductID': None, 'ProductName': None, 'CreateDate': '0', 'OpenDate': '19910403', 'ExpireDate': 99999999, 'PreClose': 15.09, 'SettlementPrice': 15.09, 'UpStopPrice': 16.6, 'DownStopPrice': 13.58, 'FloatVolume': 19405546950.0, 'TotalVolume': 19405918198.0, 'LongMarginRatio': None, 'ShortMarginRatio': None, 'PriceTick': 0.01, 'VolumeMultiple': 1, 'MainContract': None, 'LastVolume': None, 'InstrumentStatus': 0, 'IsTrading': None, 'IsRecent': None, 'ProductTradeQuota': None, 'ContractTradeQuota': None, 'ProductOpenInterestQuota': None, 'ContractOpenInterestQuota': None}

Guess you like

Origin blog.csdn.net/liuyukuan/article/details/128752572