# 获取指标列表

get_indicator_list(search_key='', lang_type=IndicatorLangType.NONE, search_mode=IndicatorSearchMode.PARTIAL)

  • 介绍

    获取指标列表(可按关键词、语言类型、匹配方式过滤)。同名指标在 MyLang 和 Python 两种实现均存在时合并为同一条目返回。

  • 参数

    参数 类型 说明
    search_key str 搜索关键词
    lang_type IndicatorLangType 指标脚本语言类型
    search_mode IndicatorSearchMode 匹配方式
  • 返回

    参数 类型 说明
    ret RET_CODE 接口调用结果
    data list 当 ret == RET_OK,返回指标条目列表
    str 当 ret != RET_OK,返回错误描述
    • 指标条目字段说明:

      字段 类型 说明
      my_lang dict 麦语言版本指标信息(若不存在则为 None)
      python dict Python 版本指标信息(若不存在则为 None)
  • Example

from moomoo import *
quote_ctx = OpenQuoteContext(host='127.0.0.1', port=11111)
ret, data = quote_ctx.get_indicator_list(search_key='MA', lang_type=IndicatorLangType.MYLANG, search_mode=IndicatorSearchMode.PARTIAL)
if ret == RET_OK:
    print(data)
else:
    print('error:', data)
quote_ctx.close() # 结束后记得关闭当条连接,防止连接条数用尽
1
2
3
4
5
6
7
8

接口限制

  • 每 30 秒内最多请求 10 次获取指标列表接口。