# 獲取指標列表

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

  • 介紹

    按關鍵詞、語言類型、匹配模式搜索指標,返回匹配的指標列表。

  • 參數

    參數 類型 說明
    search_key str 搜索關鍵詞,留空則返回全部
    lang_type IndicatorLangType 指標語言類型,NONE 表示不按語言過濾
    search_mode IndicatorSearchMode 匹配模式,默認部分匹配
  • 返回

    參數 類型 說明
    ret RET_CODE 接口調用結果
    data pd.DataFrame 當 ret == RET_OK,返回指標列表
    str 當 ret != RET_OK,返回錯誤描述
    • DataFrame 欄位說明:

      欄位 類型 說明
      short_name str 指標短名,同語言內唯一
      full_name str 指標全名
      lang_type IndicatorLangType 指標語言類型
      inputs list 輸入參數列表
      outputs list 輸出參數列表
      script str 指標腳本源碼(僅 search_mode = Exact 且 search_key 非空時返回)
  • Example

from moomoo import *
quote_ctx = OpenQuoteContext(host='127.0.0.1', port=11111)
ret, data = quote_ctx.get_indicator_list('MACD', IndicatorLangType.MYLANG, IndicatorSearchMode.PARTIAL)
if ret == RET_OK:
    print(data)
else:
    print('error:', data)
quote_ctx.close() # 結束後記得關閉當條連接,防止連接條數用盡
1
2
3
4
5
6
7
8
  • Output
  short_name full_name lang_type inputs outputs script
0       MACD      MACD    MyLang    [...]   [...]
1
2