# Get Groups From Watchlist

get_user_security_group(group_type = UserSecurityGroupType.ALL)

  • Description

    Get a list of groups from the user watchlist

  • Parameters

    Parameter Type Description
    group_type UserSecurityGroupType Group type.
  • Return

    Field Type Description
    ret RET_CODE Interface result.
    data pd.DataFrame If ret == RET_OK, group data of watchlist is returned.
    str If ret != RET_OK, error description is returned.
    • Group data of watchlist format as follows:
      Field Type Description
      group_name str Group name.
      group_type UserSecurityGroupType Group type.
  • Example

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

ret, data = quote_ctx.get_user_security_group(group_type = UserSecurityGroupType.ALL)
if ret == RET_OK:
    print(data)
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
  • Output
        group_name group_type
0          Options     SYSTEM
..         ...        ...
12          C     CUSTOM

[13 rows x 2 columns]
1
2
3
4
5
6

Interface Limitations

  • A maximum of 10 requests per 30 seconds