# Get Plates of Stocks

get_owner_plate(code_list)

  • Description

    Get the information of plates to which the stocks belong

  • Parameters

    Parameter Type Description
    code_list list Stock code list.
  • Return

    Field Type Description
    ret RET_CODE Interface result.
    data pd.DataFrame If ret == RET_OK, data of the sector is returned.
    str If ret != RET_OK, error description is returned.
    • Data of the sector format as follows:
      Field Type Description
      code str Securities code.
      name str Stock name.
      plate_code str Plate code.
      plate_name str Plate name.
      plate_type Plate Plate type.
  • Example

from moomoo import *
quote_ctx = OpenQuoteContext(host='127.0.0.1', port=11111)

code_list = ['HK.00001']
ret, data = quote_ctx.get_owner_plate(code_list)
if ret == RET_OK:
    print(data)
    print(data['code'][0]) # Take the first stock code
    print(data['plate_code'].values.tolist()) # Convert plate code to list
else:
    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
12
  • Output
    code          name          plate_code                            plate_name plate_type
0   HK.00001  CKH HOLDINGS  HK.HSI Constituent  ConstituentStocks in Hang Seng Index      OTHER
..       ...           ...                 ...                                   ...        ...
8   HK.00001  CKH HOLDINGS           HK.BK1983                                HK ADR      OTHER

[9 rows x 5 columns]
HK.00001
['HK.HSI Constituent', 'HK.GangGuTong', 'HK.BK1000', 'HK.BK1061', 'HK.BK1107', 'HK.BK1331', 'HK.BK1600', 'HK.BK1922', 'HK.BK1983']
1
2
3
4
5
6
7
8