# 修改自選股列表

modify_user_security(group_name, op, code_list)

  • 介紹

    修改指定分組的自選股列表(系統分組不支援修改)

  • 參數

    參數 類型 説明
    group_name str 需要修改的自選股分組名稱
    op ModifyUserSecurityOp 操作類型
    code_list list 股票列表
  • 返回

    參數 類型 説明
    ret RET_CODE 介面呼叫結果
    msg str 當 ret == RET_OK,返回“success”
    當 ret != RET_OK,msg 返回錯誤描述
  • 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) # 返回 success
else:
    print('error:', data)
quote_ctx.close() # 結束後記得關閉當條連線,防止連線條數用盡
1
2
3
4
5
6
7
8
9
  • Output
success
1

介面限制

  • 每 30 秒內最多請求 10 次修改自選股列表介面
  • 僅支援修改自定義分組,不支援修改系統分組
  • “全部”自選股列表的數量存在上限:無交易客戶 500 個,有交易客戶 2000 個(向其他分組增加自選股時,“全部”列表中也會同步增加)
  • 如果有同名的分組,會操作排序在第一個的分組