# Modify the Watchlist

modify_user_security(group_name, op, code_list)

  • Description

    Modify the specific group from the watchlist (you cannot modify the system group)

  • Parameters

    Parameter Type Description
    group_name str The name of the group from the watchlist that needs to be modified.
    op ModifyUserSecurityOp Operation type.
    code_list list Stock list.
  • Return

    Field Type Description
    ret RET_CODE Interface result.
    msg str If ret == RET_OK, "success" is returned.
    If ret != RET_OK, error description is returned.
  • Example

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

ret, data = quote_ctx.modify_user_security("A", ModifyUserSecurityOp.ADD, ['HK.00700'])
if ret == RET_OK:
    print(data) # Return success
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
success
1

Interface Limitations

  • A maximum of 10 requests per 30 seconds
  • You can only modify custom groups, not the system group
  • There is an upper limit on the number of "all" watchlist: 500 for untraded customers and 2000 for traded clients (when adding stocks to other groups, the "all" watchlist will also increase synchronously)
  • If there are multiple groups with a same name, the first group will be operated