# 獲取夜盤榜

get_us_overnight_rank(sort_dir=None, count=10, offset=None, filter_list=None)

  • 介紹

    獲取美股夜盤榜,返回夜盤交易時段漲跌幅排行,包含夜盤價格、漲跌幅、成交額、成交量等數據。

  • 參數

    參數 類型 說明
    sort_dir RankSortDir 排序方向,默認降序(領漲)
    count int 返回數量 [1, 200],默認 10
    offset int 起始位置,默認 0
    filter_list list[SimpleRankFilter] 篩選條件列表(多條件爲 AND 關係)
  • 輸入限制

    • filter_list 篩選條件(SimpleRankFilter):

      通過 SimpleRankFilter 構造篩選條件:

      構造參數 說明
      indicator_type 篩選因子類型(SimpleRankIndicatorType,必填)
      interval_min 範圍最小值(閉區間,MARKET_CAP/PE 使用)
      interval_max 範圍最大值(閉區間,MARKET_CAP/PE 使用)
      price_filter 價格篩選枚舉(PriceFilter,PRICE 類型必填)
  • 返回

    參數 類型 說明
    ret RET_CODE 接口調用結果
    data pd.DataFrame 當 ret == RET_OK,返回 (all_count, DataFrame) 元組
    str 當 ret != RET_OK,返回錯誤描述
    • 數據格式如下:
      字段 類型 說明
      security str 股票代碼(如 'US.NVDA'
      name str 股票名稱
      overnight_price float 夜盤價
      overnight_change_ratio float 夜盤漲跌幅(%)
      overnight_change_amount float 夜盤漲跌額
      overnight_turnover float 夜盤成交額
      overnight_volume int 夜盤成交量
      close_price float 收盤價(上一交易日)
      change_ratio float 盤中漲跌幅(%)
      change_amount float 盤中漲跌額
  • Example

from futu import *

quote_ctx = OpenQuoteContext(host='127.0.0.1', port=11111)

ret, data = quote_ctx.get_us_overnight_rank(count=2)
if ret == RET_OK:
    all_count, df = data
    print(f'總數據量: {all_count}')
    print(df)
else:
    print('error:', data)

quote_ctx.close()
1
2
3
4
5
6
7
8
9
10
11
12
13
  • Output
總數據量: 17728
  security                   name  overnight_price  overnight_change_ratio  overnight_change_amount  overnight_turnover  overnight_volume  close_price  change_ratio  change_amount
0   US.MGN                  Megan           0.3128                  81.543             1.405000e+08         1681274.123           5102016        0.172     30.303030           0.04
1  US.QNRX  Quoin Pharmaceuticals           5.2900                  62.769             2.040000e+09         1164463.400            223649        3.250    -26.303855          -1.16
1
2
3
4

接口限制

  • 30 秒內最多 60 次請求
  • 分頁請求僅首頁計入限頻統計