# 獲取到價提醒列表

get_price_reminder(code=None, market=None)

  • 介紹

    獲取對指定股票 / 指定市場設定的到價提醒列表

  • 參數

    參數 類型 説明
    code str 股票代碼
    market Market 市場類型

    注:code 和 market 都存在的情況下,code 優先。

  • 返回

    參數 類型 説明
    ret RET_CODE 介面呼叫結果
    data pd.DataFrame 當 ret == RET_OK,返回到價提醒數據
    str 當 ret != RET_OK,返回錯誤描述
    • 到價提醒數據格式如下:
      欄位 類型 説明
      code str 股票代碼
      key int 標識,用於修改到價提醒
      reminder_type PriceReminderType 到價提醒的類型
      reminder_freq PriceReminderFreq 到價提醒的頻率
      value float 提醒值
      enable bool 是否啓用
      note str 備註
      reminder_session_list list 美股到價提醒時段列表
  • Example

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

ret, data = quote_ctx.get_price_reminder(code='US.AAPL')
if ret == RET_OK:
    print(data)
    print(data['key'].values.tolist())   # 轉為 list
else:
    print('error:', data)
print('******************************************')
ret, data = quote_ctx.get_price_reminder(code=None, market=Market.US)
if ret == RET_OK:
    print(data)
    if data.shape[0] > 0:  # 如果到價提醒列表不為空
        print(data['code'][0])    # 取第一條的股票代碼
        print(data['code'].values.tolist())   # 轉為 list
else:
    print('error:', data)
quote_ctx.close() # 結束後記得關閉當條連線,防止連線條數用盡
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
  • Output
code name                  key   reminder_type reminder_freq   value  enable note                   reminder_session_list
0  US.AAPL   蘋果  1744021708234288125    BID_PRICE_UP        ALWAYS  184.37    True  456                              [US_AFTER]
1  US.AAPL   蘋果  1744022257052794489    BID_PRICE_UP        ALWAYS  185.50    True  456  [OPEN, US_PRE, US_AFTER, US_OVERNIGHT]
2  US.AAPL   蘋果  1744021708211891867  ASK_PRICE_DOWN        ALWAYS  182.54    True  123                              [US_AFTER]
3  US.AAPL   蘋果  1744022257023211123  ASK_PRICE_DOWN        ALWAYS  183.70    True  123  [OPEN, US_PRE, US_AFTER, US_OVERNIGHT]
[1744021708234288125, 1744022257052794489, 1744021708211891867, 1744022257023211123]
******************************************
      code name                  key   reminder_type reminder_freq   value  enable note                   reminder_session_list
0  US.AAPL   蘋果  1744021708234288125    BID_PRICE_UP        ALWAYS  184.37    True  456                              [US_AFTER]
1  US.AAPL   蘋果  1744022257052794489    BID_PRICE_UP        ALWAYS  185.50    True  456  [OPEN, US_PRE, US_AFTER, US_OVERNIGHT]
2  US.AAPL   蘋果  1744021708211891867  ASK_PRICE_DOWN        ALWAYS  182.54    True  123                              [US_AFTER]
3  US.AAPL   蘋果  1744022257023211123  ASK_PRICE_DOWN        ALWAYS  183.70    True  123  [OPEN, US_PRE, US_AFTER, US_OVERNIGHT]
4  US.NVDA  英偉達  1739697581665326308      PRICE_DOWN        ALWAYS  102.00    True       [OPEN, US_PRE, US_AFTER, US_OVERNIGHT]
US.AAPL
['US.AAPL', 'US.AAPL', 'US.AAPL', 'US.AAPL', 'US.NVDA']
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15

介面限制

  • 每 30 秒內最多請求 10 次獲取到價提醒列表介面