# オプション・ボラティリティ分析の取得

get_option_volatility(code, query_time_period=None, hv_time_period=None)

  • 説明

    指定したオプション・コントラクトのインプライド・ボラティリティ、ヒストリカル・ボラティリティ、ボラティリティ・プレミアムの分析データを取得する

  • パラメータ

    パラメータ 説明
    code str オプション・コード
    query_time_period OptionVolatilityTimePeriodType クエリ時間周期
    hv_time_period int ヒストリカル・ボラティリティ計算期間(日)
  • 返り値

    パラメータ 説明
    ret RET_CODE API 呼び出し結果
    data pd.DataFrame ret == RET_OK の場合はオプション・ボラティリティ・データ
    str ret != RET_OK の場合はエラー説明文字列
    • DataFrame フィールド説明:

      フィールド 説明
      timestamp int 取引日タイムスタンプ(秒単位の Unix タイムスタンプ、当日の深夜0時)
      timestamp_str str 取引日文字列
      implied_volatility float インプライド・ボラティリティ
      history_volatility float ヒストリカル・ボラティリティ
      volatility_premium float ボラティリティ・プレミアム
      average_impvol float インプライド・ボラティリティ平均値
      impvol_status OptionImpvolStatusType ボラティリティ・ステータス
      analysis str 分析テキスト
  • Example

from moomoo import *
quote_ctx = OpenQuoteContext(host='127.0.0.1', port=11111)
ret, df = quote_ctx.get_option_volatility("US.AAPL281215C320000", query_time_period=2, hv_time_period=30)
if ret == RET_OK:
    cols = ['timestamp_str', 'implied_volatility', 'history_volatility', 'volatility_premium']
    print(df[cols].to_string(index=False))
else:
    print('error:', df)
quote_ctx.close()
1
2
3
4
5
6
7
8
9
  • Output
timestamp_str  implied_volatility  history_volatility  volatility_premium
   2026-04-13              27.813              18.977               8.836
   2026-04-14              27.656              18.962               8.694
   2026-04-15              27.726              20.782               6.944
   2026-04-16              28.069              21.013               7.056
   2026-04-17              27.796              22.088               5.708
   2026-04-20              28.054              21.931               6.123
   2026-04-21              27.897              23.194               4.703
   2026-04-22              28.276              24.300               3.976
   2026-04-23              27.951              24.296               3.655
   2026-04-24              28.056              23.676               4.380
   2026-04-27              27.917              22.985               4.932
   2026-04-28              27.942              23.011               4.931
   2026-04-29              28.269              23.022               5.247
   2026-04-30              27.630              22.312               5.318
   2026-05-01              27.576              23.741               3.835
   2026-05-04              27.919              24.078               3.841
   2026-05-05              27.308              24.778               2.530
   2026-05-06              27.746              24.850               2.896
   2026-05-07              28.198              24.886               3.312
   2026-05-08              27.719              25.285               2.434
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21

API 制限

  • 30 秒以内に最大 30 回のリクエスト。
  • オプション・コントラクト・コードのみ対応。原株コードは不可。