Format: yyyy-MM-dd The default of HK stock market and A-share market is Beijing time, while that of US stock market is US Eastern time.
stock_id
int
Stock ID.
main_contract
bool
Whether future main contract.
Specific field for futures.
last_trade_time
str
Last trading time.
The field is unique to futures. Main, current month and next month futures do not have this field.
Example
from futu import*
quote_ctx = OpenQuoteContext(host='127.0.0.1', port=11111)
ret, data = quote_ctx.get_plate_stock('HK.BK1001')if ret == RET_OK:print(data)print(data['stock_name'][0])# Take the first stock nameprint(data['stock_name'].values.tolist())# Convert to listelse:print('error:', data)
quote_ctx.close()# After using the connection, remember to close it to prevent the number of connections from running out
1 2 3 4 5 6 7 8 9 10 11
Output
code lot_size stock_name stock_owner stock_child_type stock_type list_time stock_id main_contract last_trade_time
0 HK.004624000 Natural dairy NaN NaN STOCK 2005-06-1055589761712590False................................9 HK.061861000 China Feihe Limited NaN NaN STOCK 2019-11-1378159814858794False[10 rows x 10 columns]
Natural Dairy
['Natural Dairy','China Modern Dairy','Yashili International','YuanShengTai Dairy Farm','China Shengmu Organic Milk','China ZhongDi Dairy Holdings','Lanzhou Zhuangyuan Pasture','Ausnutria Dairy Corporation','China Mengniu Dairy','China Feihe Limited']
Get the list of stocks in the plate, or get the constituent stocks of the stock index
Parameters
messageC2S{requiredQot_Common.Security plate =1;//Plateoptionalint32 sortField =2;//Qot_Common.SortField, according to which field to sort, sort by stock code by defaultoptionalbool ascend =3;//True for ascending order, false for descending order, ascending by default}messageRequest{requiredC2S c2s =1;}
messageS2C{repeatedQot_Common.SecurityStaticInfo staticInfoList =1;//Static information of stocks under the plate}messageResponse{requiredint32 retType =1[default=-400];//RetType, returned valueoptionalstring retMsg =2;optionalint32 errCode =3;optionalS2C s2c =4;}
Get the list of stocks in the plate, or get the constituent stocks of the stock index
Parameters
messageC2S{requiredQot_Common.Security plate =1;//Plateoptionalint32 sortField =2;//Qot_Common.SortField, according to which field to sort, sort by stock code by defaultoptionalbool ascend =3;//True for ascending order, false for descending order, ascending by default}messageRequest{requiredC2S c2s =1;}
messageS2C{repeatedQot_Common.SecurityStaticInfo staticInfoList =1;//Static information of stocks under the plate}messageResponse{requiredint32 retType =1[default=-400];//RetType, returned valueoptionalstring retMsg =2;optionalint32 errCode =3;optionalS2C s2c =4;}
int getPlateSecurity(QotGetPlateSecurity.Request req); void onReply_GetPlateSecurity(FTAPI_Conn client, int nSerialNo, QotGetPlateSecurity.Response rsp);
Introduction
Get the list of stocks in the plate, or get the constituent stocks of the stock index
Parameters
messageC2S{requiredQot_Common.Security plate =1;//Plateoptionalint32 sortField =2;//Qot_Common.SortField, according to which field to sort, sort by stock code by defaultoptionalbool ascend =3;//True for ascending order, false for descending order, ascending by default}messageRequest{requiredC2S c2s =1;}
messageS2C{repeatedQot_Common.SecurityStaticInfo staticInfoList =1;//Static information of stocks under the plate}messageResponse{requiredint32 retType =1[default=-400];//RetType, returned valueoptionalstring retMsg =2;optionalint32 errCode =3;optionalS2C s2c =4;}
Get the list of stocks in the plate, or get the constituent stocks of the stock index
Parameters
messageC2S{requiredQot_Common.Security plate =1;//Plateoptionalint32 sortField =2;//Qot_Common.SortField, according to which field to sort, sort by stock code by defaultoptionalbool ascend =3;//True for ascending order, false for descending order, ascending by default}messageRequest{requiredC2S c2s =1;}
messageS2C{repeatedQot_Common.SecurityStaticInfo staticInfoList =1;//Static information of stocks under the plate}messageResponse{requiredint32 retType =1[default=-400];//RetType, returned valueoptionalstring retMsg =2;optionalint32 errCode =3;optionalS2C s2c =4;}
Get the list of stocks in the plate, or get the constituent stocks of the stock index
Parameters
messageC2S{requiredQot_Common.Security plate =1;//Plateoptionalint32 sortField =2;//Qot_Common.SortField, according to which field to sort, sort by stock code by defaultoptionalbool ascend =3;//True for ascending order, false for descending order, ascending by default}messageRequest{requiredC2S c2s =1;}
messageS2C{repeatedQot_Common.SecurityStaticInfo staticInfoList =1;//Static information of stocks under the plate}messageResponse{requiredint32 retType =1[default=-400];//RetType, returned valueoptionalstring retMsg =2;optionalint32 errCode =3;optionalS2C s2c =4;}
import ftWebsocket from"futu-api";import{ ftCmdID }from"futu-api";import{ Common, Qot_Common }from"futu-api/proto";import beautify from"js-beautify";functionQotGetPlateSecurity(){const{ RetType }= Common
const{ QotMarket }= Qot_Common
let[addr, port, enable_ssl, key]=["127.0.0.1",33333,false,'7522027ccf5a06b1'];let websocket =newftWebsocket();
websocket.onlogin=(ret, msg)=>{if(ret){const req ={c2s:{plate:{market: QotMarket.QotMarket_HK_Security,code:"Motherboard",},},};
websocket.GetPlateSecurity(req).then((res)=>{let{ errCode, retMsg, retType,s2c }= res
console.log("PlateSecurity: errCode %d, retMsg %s, retType %d", errCode, retMsg, retType);if(retType == RetType.RetType_Succeed){let data =beautify(JSON.stringify(s2c),{indent_size:2,space_in_empty_paren:true,});
console.log(data);}}).catch((error)=>{
console.log("error:", error);});}else{
console.log("error", msg);}};
websocket.start(addr, port, enable_ssl, key);// After using the connection, remember to close it to prevent the number of connections from running outsetTimeout(()=>{
websocket.stop();
console.log("stop");},5000);// Set the script to receive FutuOpenD push duration to 5 seconds}