# 取得資金フロー

get_capital_flow(stock_code, period_type = PeriodType.INTRADAY, start=None, end=None)

  • 概要

    個別銘柄の資金フローの取得

  • パラメータ

    パラメータ 説明
    stock_code str 銘柄コード
    period_type PeriodType 周期タイプ
    start str 開始時間
    end str 結束時間
    • start と end の組み合わせは以下の通りです
      start タイプ end タイプ 説明
      str str start と end はそれぞれ指定した日付
      None str start 為 end 往前 365 天
      str None end 為 start 往后 365 天
      None None end は当日、start は365日前
  • 戻り値

    パラメータ 説明
    ret RET_CODE API呼び出し結果
    data pd.DataFrame ret == RET_OK の場合、資金フローデータ
    str ret != RET_OK の場合、エラーの説明を返す
    • 資金フローデータフォーマットは以下の通りです:
      フィールド タイプ 説明
      in_flow float 整体純流入額
      main_in_flow float 主力大口純流入額
      super_in_flow float 特大口純流入額
      big_in_flow float 大口純流入額
      mid_in_flow float 中口純流入額
      sml_in_flow float 小口純流入額
      capital_flow_item_time str 開始時間
      last_valid_time str データ最終有効時間
  • Example

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

ret, data = quote_ctx.get_capital_flow("HK.00700", period_type = PeriodType.INTRADAY)
if ret == RET_OK:
    print(data)
    print(data['in_flow'][0])    # 最初のレコードの純流入資金額を取得
    print(data['in_flow'].values.tolist())   # list に変換
else:
    print('error:', data)
quote_ctx.close() # 使用後は接続をクローズしてください。接続数の枯渇を防止します。
1
2
3
4
5
6
7
8
9
10
11
  • Output
    last_valid_time       in_flow  ...  main_in_flow  capital_flow_item_time
0               N/A -1.857915e+08  ... -1.066828e+08     2021-06-08 00:00:00
..              ...           ...  ...           ...                     ...
245             N/A  2.179240e+09  ...  2.143345e+09     2022-06-08 00:00:00

[246 rows x 8 columns]
-185791500.0
[-185791500.0, -18315000.0, -672100100.0, -714394350.0, -698391950.0, -818886750.0, 304827400.0, 73026200.0, -2078217500.0, 
..                   ...           ...                    ...
2031460.0, 638067040.0, 622466600.0, -351788160.0, -328529240.0, 715415020.0, 76749700.0, 2179240320.0]
1
2
3
4
5
6
7
8
9
10

APIレート制限

  • 30 秒以内に最大 30 回資金フローAPI。
  • のみサポート正株、ワラント和基金。
  • 過去の周期(日、月、年)は直近1年分のデータのみ提供。リアルタイム周期は最新1日分のデータのみ提供。
  • 返却データは場中データのみで、プレマーケット・アフターマーケットのデータは含まれません。