# ワラントのフィルタ

get_warrant(stock_owner='', req=None)

  • 概要

    ワラントのフィルタ(香港市場のワラント、CBBC、インラインワラントのフィルタ専用)

  • パラメータ

    パラメータ 説明
    stock_owner str 原資産の銘柄コード
    req WarrantRequest フィルタパラメータの組み合わせ
    • WarrantRequest タイプのフィールド説明:
      フィールド タイプ 説明
      begin int データ開始位置
      num int リクエストデータ件数
      sort_field SortField ソートフィールド
      ascend bool ソート方向
      type_list list ワラントタイプフィルタリスト
      issuer_list list 発行体フィルタリスト
      maturity_time_min str 満期日フィルタ範囲の開始時刻
      maturity_time_max str 満期日フィルタ範囲の終了時刻
      ipo_period IpoPeriod 上場期間
      price_type PriceType イン・ザ・マネー/アウト・オブ・ザ・マネー
      status WarrantStatus ワラントステータス
      cur_price_min float 最新値のフィルタ下限
      cur_price_max float 最新値のフィルタ上限
      strike_price_min float 行使価格のフィルタ下限
      strike_price_max float 行使価格のフィルタ上限
      street_min float ストリート在庫比率のフィルタ下限
      street_max float ストリート在庫比率のフィルタ上限
      conversion_min float 転換比率のフィルタ下限
      conversion_max float 転換比率のフィルタ上限
      vol_min int 出来高のフィルタ下限
      vol_max int 出来高のフィルタ上限
      premium_min float プレミアムのフィルタ下限
      premium_max float プレミアムのフィルタ上限
      leverage_ratio_min float レバレッジ比率のフィルタ下限
      leverage_ratio_max float レバレッジ比率のフィルタ上限
      delta_min float デルタ値のフィルタ下限
      delta_max float デルタ値のフィルタ上限
      implied_min float インプライドボラティリティのフィルタ下限
      implied_max float インプライドボラティリティのフィルタ上限
      recovery_price_min float 回収価格のフィルタ下限
      recovery_price_max float 回収価格のフィルタ上限
      price_recovery_ratio_min float 原資産から回収価格までの距離のフィルタ下限
      price_recovery_ratio_max float 原資産から回収価格までの距離のフィルタ上限
  • 戻り値

    パラメータ 説明
    ret RET_CODE API呼び出し結果
    data tuple ret == RET_OK の場合、ワラントデータを返します
    str ret != RET_OK の場合、エラーの説明を返す
    • ワラントデータの構成:

      フィールド タイプ 説明
      warrant_data_list pd.DataFrame フィルタ後のワラントデータ
      last_page bool 最終ページかどうか
      all_count int フィルタ結果のワラント総数
      • warrant_data_list が返す pd dataframe のデータフォーマット:
        フィールド タイプ 説明
        stock str ワラントコード
        stock_owner str 原資産銘柄
        type WrtType ワラントタイプ
        issuer Issuer 発行体
        maturity_time str 満期日
        list_time str 上場日
        last_trade_time str 最終取引日
        recovery_price float 回収価格
        conversion_ratio float 転換比率
        lot_size int 1ロットあたりの数量
        strike_price float 行使価格
        last_close_price float 前日終値
        name str 名前
        cur_price float 現在値
        price_change_val float 騰落額
        status WarrantStatus ワラントステータス
        bid_price float 買値
        ask_price float 売値
        bid_vol int 買い数量
        ask_vol int 売り数量
        volume int 出来高
        turnover float 売買代金
        score float 総合スコア
        premium float プレミアム
        break_even_point float 損益分岐点
        leverage float レバレッジ比率
        ipop float イン・ザ・マネー/アウト・オブ・ザ・マネー
        price_recovery_ratio float 原資産から回収価格までの距離
        conversion_price float 転換価格
        street_rate float ストリート在庫比率
        street_vol int ストリート在庫数量
        amplitude float 振幅
        issue_size int 発行量
        high_price float 高値
        low_price float 安値
        implied_volatility float インプライドボラティリティ
        delta float デルタ値
        effective_leverage float 実効レバレッジ
        upper_strike_price float 上限価格
        lower_strike_price float 下限価格
        inline_price_status PriceType インライン/アウトライン
  • Example

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

req = WarrantRequest()
req.sort_field = SortField.TURNOVER
req.type_list = WrtType.CALL
req.cur_price_min = 0.1
req.cur_price_max = 0.2
ret, ls = quote_ctx.get_warrant("HK.00700", req)
if ret == RET_OK:  # 先にAPIの戻り値が正常かを判定してからデータを取得
    warrant_data_list, last_page, all_count = ls
    print(len(warrant_data_list), all_count, warrant_data_list)
    print(warrant_data_list['stock'][0])    # 1件目のワラントコードを取得
    print(warrant_data_list['stock'].values.tolist())   # list に変換
else:
    print('error: ', ls)
    
req = WarrantRequest()
req.sort_field = SortField.TURNOVER
req.issuer_list = ['UB','CS','BI']
ret, ls = quote_ctx.get_warrant(Market.HK, req)
if ret == RET_OK: 
    warrant_data_list, last_page, all_count = ls
    print(len(warrant_data_list), all_count, warrant_data_list)
else:
    print('error: ', ls)

quote_ctx.close()  # 全APIの最後にcloseを追加し、接続数の枯渇を防止
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
  • Output
2 2 
    stock        name stock_owner  type issuer maturity_time   list_time last_trade_time  recovery_price  conversion_ratio  lot_size  strike_price  last_close_price  cur_price  price_change_val  change_rate  status  bid_price  ask_price   bid_vol  ask_vol    volume   turnover   score  premium  break_even_point  leverage    ipop  price_recovery_ratio  conversion_price  street_rate  street_vol  amplitude  issue_size  high_price  low_price  implied_volatility  delta  effective_leverage  list_timestamp  last_trade_timestamp  maturity_timestamp  upper_strike_price  lower_strike_price  inline_price_status
0   HK.20306  腾讯麦银零乙购A.C    HK.00700  CALL     MB    2020-12-01  2019-06-27      2020-11-25             NaN              50.0      5000        588.88             0.188      0.188             0.000     0.000000  NORMAL      0.000      0.188         0     10000           0          0.0   0.198    2.008            598.28    62.393  -0.404                   NaN              9.40        4.400     1584000      0.000    36000000       0.000      0.000              31.751  0.479              29.886    1.561565e+09          1.606234e+09        1.606752e+09                 NaN                 NaN                  NaN
1   HK.16545  腾讯法兴一二购B.C    HK.00700  CALL     SG    2021-02-26  2020-07-14      2021-02-22             NaN             100.0     10000        700.00             0.147      0.144            -0.003    -2.040816  NORMAL      0.141      0.144  28000000  28000000           0          0.0  81.506   21.807            714.40    40.729 -16.214                   NaN             14.40        1.420     2130000      0.000   150000000       0.000      0.000              40.643  0.226               9.204    1.594656e+09          1.613923e+09        1.614269e+09                 NaN                 NaN                  NaN
HK.20306
['HK.20306', 'HK.16545']

200 358
    stock        name stock_owner    type issuer maturity_time   list_time last_trade_time  recovery_price  conversion_ratio  lot_size  strike_price  last_close_price  cur_price  price_change_val  change_rate      status  bid_price  ask_price   bid_vol   ask_vol  volume  turnover   score  premium  break_even_point  leverage     ipop  price_recovery_ratio  conversion_price  street_rate  street_vol  amplitude  issue_size  high_price  low_price  implied_volatility  delta  effective_leverage  list_timestamp  last_trade_timestamp  maturity_timestamp  upper_strike_price  lower_strike_price inline_price_status
0    HK.19839  平安瑞银零乙购A.C    HK.02318    CALL     UB    2020-12-31  2017-12-11      2020-12-24             NaN             100.0     50000         83.88             0.057      0.046            -0.011   -19.298246      NORMAL      0.043      0.046  30000000  30000000       0       0.0  39.641    1.642            88.480    18.923    3.779                   NaN             4.600         1.25     6250000        0.0   500000000         0.0        0.0              25.129  0.692              13.094    1.512922e+09          1.608739e+09        1.609344e+09                 NaN                 NaN                 NaN
1    HK.20084  平安中银零乙购A.C    HK.02318    CALL     BI    2020-12-31  2017-12-19      2020-12-24             NaN             100.0     50000         83.88             0.059      0.050            -0.009   -15.254237      NORMAL      0.044      0.050  10000000  10000000       0       0.0   0.064    2.102            88.880    17.410    3.779                   NaN             5.000         0.07      350000        0.0   500000000         0.0        0.0              29.174  0.672              11.699    1.513613e+09          1.608739e+09        1.609344e+09                 NaN                 NaN                 NaN
......
198  HK.56886  恒指瑞银三一牛F.C   HK.800000    BULL     UB    2023-01-30  2020-03-24      2023-01-27         21200.0           20000.0     10000      21100.00             0.230      0.232             0.002     0.869565      NORMAL      0.232      0.233  30000000  30000000       0       0.0  46.627   -2.884         25740.000     5.712   25.613             25.021179          4640.000         0.01       40000        0.0   400000000         0.0        0.0                 NaN    NaN               5.712    1.584979e+09          1.674749e+09        1.675008e+09                 NaN                 NaN                 NaN
199  HK.56895  小米瑞银零乙牛D.C    HK.01810    BULL     UB    2020-12-30  2020-03-24      2020-12-29             8.0              10.0      2000          7.60             2.010      1.930            -0.080    -3.980100      NORMAL      1.910      1.930   6000000   6000000       0       0.0   0.040    0.938            26.900     1.380  250.657            233.125000            19.300         0.10       60000        0.0    60000000         0.0        0.0                 NaN    NaN               1.380    1.584979e+09          1.609171e+09        1.609258e+09                 NaN                 NaN                 NaN

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15

APIレート制限

  • 香港株BMP権限ではこのAPIに対応していません
  • 30秒以内にワラントフィルタAPIを最大60回までリクエスト可能です
  • 1回のリクエストデータ件数の上限は200件です