# Get Period Change Rank

get_period_change_rank(market, period_type=None, sort_dir=None, count=10, offset=None, filter_list=None)

  • Description

    Get period change rank, returning change rate rankings in a specified market by different time periods (5 minutes to 250 days/year-to-date), supporting rich filter conditions (market cap, price, PE, PB, turnover rate, volume ratio, amplitude, etc.).

  • Parameters

    Parameter Type Description
    market Market Market type (HK/US) (required)
    period_type RankPeriodType Rank period, default 5 minutes
    sort_dir RankSortDir Sort direction, default descending
    count int Return count [1, 200], default 10
    offset int Start position, default 0
    filter_list list[PeriodChangeRankFilter] Filter condition list (multiple conditions are AND-combined)
  • Input Limits

    • filter_list Filter Conditions(PeriodChangeRankFilter):

      Constructor Parameter Description
      indicator_type Filter indicator type (PeriodChangeIndicatorType, required)
      interval_min Range minimum (closed interval)
      interval_max Range maximum (closed interval)
  • Return

    Parameter Type Description
    ret RET_CODE API call result
    data pd.DataFrame When ret == RET_OK, returns (all_count, DataFrame) tuple
    str When ret != RET_OK, returns error description
    • Data format:
      Field Type Description
      security str Stock code (e.g. 'US.AAPL')
      name str Stock name
      cur_price float Latest price
      change_ratio float Today's change rate (%)
      turnover float Turnover
      volume int Volume
      market_cap float Market cap
      change_rate_5min float 5-minute change rate (%)
      change_rate_5d float 5-day change rate (%)
      change_rate_10d float 10-day change rate (%)
      change_rate_20d float 20-day change rate (%)
      change_rate_60d float 60-day change rate (%)
      change_rate_120d float 120-day change rate (%)
      change_rate_250d float 250-day change rate (%)
      change_rate_ytd float Year-to-date change rate (%)
      pe_ttm float P/E ratio TTM
      pb float P/B ratio
      turnover_ratio float Turnover rate (%)
      volume_ratio float Volume ratio
      amplitude float Amplitude (%)
  • Example

from futu import *

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

ret, data = quote_ctx.get_period_change_rank(market=Market.US, count=2)
if ret == RET_OK:
    all_count, df = data
    print(f'Total count: {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
总数据量: 6429
  security                           name  cur_price  change_ratio  turnover  volume   market_cap  change_rate_5min  change_rate_5d  change_rate_10d  change_rate_20d  change_rate_60d  change_rate_120d  change_rate_250d  change_rate_ytd   pe_ttm       pb  turnover_ratio  volume_ratio  amplitude
0   US.JYD                         佳裕达物流       0.93        11.537  271197.0  311313   7717977.00             9.540           32.80           30.875           20.779          -68.150           -80.128           -90.610          -81.374 -0.40558  0.49892           5.220         0.732      20.94
1  US.RAIN  Rain Enhancement Technologies       2.23        19.892  112286.0   56451  18261097.59             9.313           -2.62            1.826           -6.302          -21.754           -71.914           -22.299          -61.815 -1.79838 -1.27283           2.812         0.816      27.15
1
2
3
4

API Limits

  • Maximum 60 requests within 30 seconds
  • Only the first page of paginated requests counts toward rate limit