# 期權異動
- Python
- Proto
- C#
- Java
- C++
- JavaScript
get_option_event(option_market, count=None, page=None, filter_list=None, sort=None)
介紹
獲取期權異動列表,返回大單成交、掃單等期權異動記錄,支持按標的、合約屬性、成交信息、希臘值等多維度篩選和排序。
參數
參數 類型 說明 option_market OptionMarket 期權市場類型 US_SECURITY=美股股票期權、US_INDEX=美股指數期權、HK_SECURITY=港股股票期權、HK_INDEX=港股指數期權count int 每頁數量 範圍 [1,300]page str 分頁標記 首次傳空字符串,翻頁傳上次返回的 next_pagefilter_list list[EventFilter] 篩選條件列表 多條件為 AND 關係。支持按標的(OWNER_LIST)、行業板塊、期權類型(CALL/PUT)、成交方向、成交量、成交額、IV、Delta 等篩選sort EventSort 排序 默認按時間降序返回
參數 類型 說明 ret RET_CODE 接口調用結果 data dict 當 ret == RET_OK,返回異動數據 str 當 ret != RET_OK,返回錯誤描述 data 字典包含:
字段 類型 說明 event_list pandas.DataFrame 異動列表 next_page str 下一頁標記 空字符串表示沒有更多頁all_count int 總條數 update_timestamp float 數據更新時間戳 event_list DataFrame 字段:
字段 類型 說明 option_code str 期權合約代碼 owner_code str 標的股票代碼 symbol str 標的 display code(如 TSLA) fill_time str 成交時間 fill_timestamp float 成交時間戳(Unix 秒) ticker_type str 成交方向 BUY/SELL/NEUTRALprice float 成交價 volume int 成交量(張) turnover float 成交額 option_type str 期權類型 CALL/PUTstrike_price float 行權價 strike_time str 到期日 strike_timestamp float 到期時間戳(Unix 秒) dte int 距到期天數 underlying_price float 標的價格 otm float 價外比率(百分比) bid_price float 買一價 ask_price float 賣一價 iv float 隱含波動率(百分比) total_volume int 期權當日總成交量 total_open_interest int 期權當日總持倉量 vo_ratio float 量倉比(百分比) delta float Delta gamma float Gamma vega float Vega theta float Theta rho float Rho sentiment str 市場情緒 BEARISH/BULLISH/NEUTRALorder_type_list list 訂單類型列表 NORMAL/SWEEP/CROSS/FLOORstrategy_type str 策略類型 SINGLE_LEG/MULTI_LEGearnings_time str 業績時間 earnings_pub_type int 業績發佈類型 corporate_action_list list 企業行動列表 industry_plate_list list 行業板塊列表 concept_plate_list list 概念板塊列表
Example
from futu import *
quote_ctx = OpenQuoteContext(host='127.0.0.1', port=11111)
ret, data = quote_ctx.get_option_event(OptionMarket.US_SECURITY, count=5)
if ret == RET_OK:
print(data['event_list'])
print('all_count:', data['all_count'])
else:
print('error:', data)
quote_ctx.close()
2
3
4
5
6
7
8
9
10
11
12
- Output
option_code owner_code symbol fill_time fill_timestamp ticker_type price volume turnover option_type strike_price strike_time strike_timestamp dte underlying_price otm bid_price ask_price iv total_volume total_open_interest vo_ratio delta gamma vega theta rho sentiment order_type_list strategy_type earnings_time earnings_pub_type corporate_action_list industry_plate_list concept_plate_list
0 US.TLT260618C86000 US.TLT TLT 2026-06-12 16:14:00 1.781295e+09 SELL 0.280000 10000 280000.0 CALL 86.0 2026-06-18 1.781759e+09 3 85.77 0.268 0.28 0.30 8.240 70108 88849 0.78906 0.424382 0.432194 0.043077 -0.034441 0.005940 BEARISH [SWEEP, NORMAL] SINGLE_LEG N/A N/A N/A N/A N/A
1 US.TLT260618C86000 US.TLT TLT 2026-06-12 16:13:18 1.781295e+09 SELL 0.280000 7821 218988.0 CALL 86.0 2026-06-18 1.781759e+09 3 85.77 0.268 0.28 0.30 8.240 60104 88849 0.67647 0.424382 0.432194 0.043077 -0.034441 0.005940 BEARISH [SWEEP, NORMAL] SINGLE_LEG N/A N/A N/A N/A N/A
2 US.IWM260618P285000 US.IWM IWM 2026-06-12 16:07:53 1.781295e+09 SELL 1.320000 3002 396264.0 PUT 285.0 2026-06-18 1.781759e+09 3 292.96 2.717 1.32 1.35 28.323 57418 26731 2.14799 -0.214110 0.027402 0.109475 -0.256980 -0.009801 BULLISH [SWEEP, NORMAL] SINGLE_LEG N/A N/A [{'action_type': 7, 'action_time': '2026-06-15', 'action_timestamp': ...}] N/A N/A
3 US.SPY260717P706000 US.SPY SPY 2026-06-12 16:04:46 1.781295e+09 BUY 4.333523 3872 1677940.0 PUT 706.0 2026-07-17 1.784264e+09 32 741.77 4.822 4.29 4.35 19.000 22269 8169 2.72603 -0.177726 0.005982 0.596630 -0.150480 -0.113947 BEARISH [SWEEP, NORMAL] SINGLE_LEG N/A N/A N/A N/A [US.LIST2153]
4 US.SPY260717P704000 US.SPY SPY 2026-06-12 16:04:26 1.781295e+09 SELL 4.060235 6767 2747561.0 PUT 704.0 2026-07-17 1.784264e+09 32 741.77 5.091 4.05 4.10 19.214 17712 7842 2.25860 -0.167963 0.005705 0.575554 -0.147087 -0.107775 BULLISH [NORMAL] SINGLE_LEG N/A N/A N/A N/A [US.LIST2153]
all_count: 164620
2
3
4
5
6
7
# Qot_GetOptionEvent.proto
介紹
獲取期權異動列表
參數
message EventIndicator
{
required int32 indicatorType = 1; //EventIndicatorType,篩選指標類型
optional Qot_OptionCommon.IndicatorValue indicatorValue = 2; //篩選指標值
}
message EventSort
{
required int32 indicatorType = 1; //排序指標類型
required bool isAsc = 2; //是否升序
}
message C2S
{
required int32 optionMarket = 1; //期權市場類型
optional int32 count = 2; //每頁數量[1,300]
optional string page = 3; //分頁標記,首次傳空字符串
repeated EventIndicator filterList = 4; //篩選條件列表
optional EventSort sort = 5; //排序
}
message Request
{
required C2S c2s = 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
- 返回
message CorporateAction
{
optional int32 actionType = 1; //企業行動類型
optional string actionTime = 2; //企業行動時間
}
message EventItem
{
optional Qot_Common.Security option = 1; //期權合約
optional Qot_Common.Security owner = 2; //標的股票
optional string symbol = 3; //標的顯示代碼
optional string fillTime = 10; //成交時間
optional double fillTimestamp = 11; //成交時間戳(Unix 秒)
optional int32 tickerType = 12; //成交方向:1=BUY、2=SELL、3=NEUTRAL
optional double price = 13; //成交價
optional int64 volume = 14; //成交量(張)
optional double turnover = 15; //成交額
optional int32 optionType = 20; //期權類型:1=CALL、2=PUT
optional double strikePrice = 21; //行權價
optional string strikeTime = 22; //到期日
optional double strikeTimestamp = 23; //到期時間戳(Unix 秒)
optional int32 dte = 24; //距到期天數
optional double underlyingPrice = 30; //標的價格
optional double otm = 31; //價外比率(百分比)
optional double bidPrice = 32; //買一價
optional double askPrice = 33; //賣一價
optional double iv = 34; //隱含波動率(百分比)
optional int64 totalVolume = 35; //期權當日總成交量
optional int64 totalOpenInterest = 36; //期權當日總持倉量
optional double voRatio = 37; //量倉比(百分比)
optional double delta = 40; //Delta
optional double gamma = 41; //Gamma
optional double vega = 42; //Vega
optional double theta = 43; //Theta
optional double rho = 44; //Rho
optional int32 sentiment = 50; //市場情緒:1=BEARISH、2=BULLISH、3=NEUTRAL
repeated int32 orderTypeList = 51; //訂單類型列表:0=NORMAL、1=SWEEP、2=CROSS、4=FLOOR
optional int32 strategyType = 52; //策略類型:1=SINGLE_LEG、2=MULTI_LEG
optional string earningsTime = 60; //業績時間
optional int32 earningsPubType = 61; //業績發佈類型
repeated CorporateAction corporateActionList = 63; //企業行動列表
repeated Qot_Common.Security industryPlateList = 64; //行業板塊列表
repeated Qot_Common.Security conceptPlateList = 65; //概念板塊列表
}
message S2C
{
repeated EventItem eventList = 1; //異動列表
optional string nextPage = 2; //下一頁標記,空字符串表示沒有更多頁
optional int32 allCount = 3; //總條數
optional double updateTimestamp = 4; //數據更新時間戳
}
message Response
{
required int32 retType = 1 [default = -400]; //RetType,返回結果
optional string retMsg = 2;
optional int32 errCode = 3;
optional S2C s2c = 4;
}
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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
- 接口調用結果,結構參見 RetType
協議 ID
3307
uint GetOptionEvent(Qot_GetOptionEvent.Request req); virtual void OnReply_GetOptionEvent(FTAPI_Conn client, uint nSerialNo, Qot_GetOptionEvent.Response rsp);
介紹
獲取期權異動列表
參數
message EventIndicator
{
required int32 indicatorType = 1; //EventIndicatorType,篩選指標類型
optional Qot_OptionCommon.IndicatorValue indicatorValue = 2; //篩選指標值
}
message EventSort
{
required int32 indicatorType = 1; //排序指標類型
required bool isAsc = 2; //是否升序
}
message C2S
{
required int32 optionMarket = 1; //期權市場類型
optional int32 count = 2; //每頁數量[1,300]
optional string page = 3; //分頁標記,首次傳空字符串
repeated EventIndicator filterList = 4; //篩選條件列表
optional EventSort sort = 5; //排序
}
message Request
{
required C2S c2s = 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
- 返回
message CorporateAction
{
optional int32 actionType = 1; //企業行動類型
optional string actionTime = 2; //企業行動時間
}
message EventItem
{
optional Qot_Common.Security option = 1; //期權合約
optional Qot_Common.Security owner = 2; //標的股票
optional string symbol = 3; //標的顯示代碼
optional string fillTime = 10; //成交時間
optional double fillTimestamp = 11; //成交時間戳(Unix 秒)
optional int32 tickerType = 12; //成交方向:1=BUY、2=SELL、3=NEUTRAL
optional double price = 13; //成交價
optional int64 volume = 14; //成交量(張)
optional double turnover = 15; //成交額
optional int32 optionType = 20; //期權類型:1=CALL、2=PUT
optional double strikePrice = 21; //行權價
optional string strikeTime = 22; //到期日
optional double strikeTimestamp = 23; //到期時間戳(Unix 秒)
optional int32 dte = 24; //距到期天數
optional double underlyingPrice = 30; //標的價格
optional double otm = 31; //價外比率(百分比)
optional double bidPrice = 32; //買一價
optional double askPrice = 33; //賣一價
optional double iv = 34; //隱含波動率(百分比)
optional int64 totalVolume = 35; //期權當日總成交量
optional int64 totalOpenInterest = 36; //期權當日總持倉量
optional double voRatio = 37; //量倉比(百分比)
optional double delta = 40; //Delta
optional double gamma = 41; //Gamma
optional double vega = 42; //Vega
optional double theta = 43; //Theta
optional double rho = 44; //Rho
optional int32 sentiment = 50; //市場情緒:1=BEARISH、2=BULLISH、3=NEUTRAL
repeated int32 orderTypeList = 51; //訂單類型列表:0=NORMAL、1=SWEEP、2=CROSS、4=FLOOR
optional int32 strategyType = 52; //策略類型:1=SINGLE_LEG、2=MULTI_LEG
optional string earningsTime = 60; //業績時間
optional int32 earningsPubType = 61; //業績發佈類型
repeated CorporateAction corporateActionList = 63; //企業行動列表
repeated Qot_Common.Security industryPlateList = 64; //行業板塊列表
repeated Qot_Common.Security conceptPlateList = 65; //概念板塊列表
}
message S2C
{
repeated EventItem eventList = 1; //異動列表
optional string nextPage = 2; //下一頁標記,空字符串表示沒有更多頁
optional int32 allCount = 3; //總條數
optional double updateTimestamp = 4; //數據更新時間戳
}
message Response
{
required int32 retType = 1 [default = -400]; //RetType,返回結果
optional string retMsg = 2;
optional int32 errCode = 3;
optional S2C s2c = 4;
}
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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
- 接口調用結果,結構參見 RetType
協議 ID
3307
int getOptionEvent(Qot_GetOptionEvent.Request req) onReply_GetOptionEvent(FTAPI_Conn client, int nSerialNo, Qot_GetOptionEvent.Response rsp)
介紹
獲取期權異動列表
參數
message EventIndicator
{
required int32 indicatorType = 1; //EventIndicatorType,篩選指標類型
optional Qot_OptionCommon.IndicatorValue indicatorValue = 2; //篩選指標值
}
message EventSort
{
required int32 indicatorType = 1; //排序指標類型
required bool isAsc = 2; //是否升序
}
message C2S
{
required int32 optionMarket = 1; //期權市場類型
optional int32 count = 2; //每頁數量[1,300]
optional string page = 3; //分頁標記,首次傳空字符串
repeated EventIndicator filterList = 4; //篩選條件列表
optional EventSort sort = 5; //排序
}
message Request
{
required C2S c2s = 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
- 返回
message CorporateAction
{
optional int32 actionType = 1; //企業行動類型
optional string actionTime = 2; //企業行動時間
}
message EventItem
{
optional Qot_Common.Security option = 1; //期權合約
optional Qot_Common.Security owner = 2; //標的股票
optional string symbol = 3; //標的顯示代碼
optional string fillTime = 10; //成交時間
optional double fillTimestamp = 11; //成交時間戳(Unix 秒)
optional int32 tickerType = 12; //成交方向:1=BUY、2=SELL、3=NEUTRAL
optional double price = 13; //成交價
optional int64 volume = 14; //成交量(張)
optional double turnover = 15; //成交額
optional int32 optionType = 20; //期權類型:1=CALL、2=PUT
optional double strikePrice = 21; //行權價
optional string strikeTime = 22; //到期日
optional double strikeTimestamp = 23; //到期時間戳(Unix 秒)
optional int32 dte = 24; //距到期天數
optional double underlyingPrice = 30; //標的價格
optional double otm = 31; //價外比率(百分比)
optional double bidPrice = 32; //買一價
optional double askPrice = 33; //賣一價
optional double iv = 34; //隱含波動率(百分比)
optional int64 totalVolume = 35; //期權當日總成交量
optional int64 totalOpenInterest = 36; //期權當日總持倉量
optional double voRatio = 37; //量倉比(百分比)
optional double delta = 40; //Delta
optional double gamma = 41; //Gamma
optional double vega = 42; //Vega
optional double theta = 43; //Theta
optional double rho = 44; //Rho
optional int32 sentiment = 50; //市場情緒:1=BEARISH、2=BULLISH、3=NEUTRAL
repeated int32 orderTypeList = 51; //訂單類型列表:0=NORMAL、1=SWEEP、2=CROSS、4=FLOOR
optional int32 strategyType = 52; //策略類型:1=SINGLE_LEG、2=MULTI_LEG
optional string earningsTime = 60; //業績時間
optional int32 earningsPubType = 61; //業績發佈類型
repeated CorporateAction corporateActionList = 63; //企業行動列表
repeated Qot_Common.Security industryPlateList = 64; //行業板塊列表
repeated Qot_Common.Security conceptPlateList = 65; //概念板塊列表
}
message S2C
{
repeated EventItem eventList = 1; //異動列表
optional string nextPage = 2; //下一頁標記,空字符串表示沒有更多頁
optional int32 allCount = 3; //總條數
optional double updateTimestamp = 4; //數據更新時間戳
}
message Response
{
required int32 retType = 1 [default = -400]; //RetType,返回結果
optional string retMsg = 2;
optional int32 errCode = 3;
optional S2C s2c = 4;
}
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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
- 接口調用結果,結構參見 RetType
協議 ID
3307
Futu::u32_t GetOptionEvent(const Qot_GetOptionEvent::Request &stReq);
virtual void OnReply_GetOptionEvent(Futu::u32_t nSerialNo, const Qot_GetOptionEvent::Response &stRsp) = 0;
介紹
獲取期權異動列表
參數
message EventIndicator
{
required int32 indicatorType = 1; //EventIndicatorType,篩選指標類型
optional Qot_OptionCommon.IndicatorValue indicatorValue = 2; //篩選指標值
}
message EventSort
{
required int32 indicatorType = 1; //排序指標類型
required bool isAsc = 2; //是否升序
}
message C2S
{
required int32 optionMarket = 1; //期權市場類型
optional int32 count = 2; //每頁數量[1,300]
optional string page = 3; //分頁標記,首次傳空字符串
repeated EventIndicator filterList = 4; //篩選條件列表
optional EventSort sort = 5; //排序
}
message Request
{
required C2S c2s = 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
- 返回
message CorporateAction
{
optional int32 actionType = 1; //企業行動類型
optional string actionTime = 2; //企業行動時間
}
message EventItem
{
optional Qot_Common.Security option = 1; //期權合約
optional Qot_Common.Security owner = 2; //標的股票
optional string symbol = 3; //標的顯示代碼
optional string fillTime = 10; //成交時間
optional double fillTimestamp = 11; //成交時間戳(Unix 秒)
optional int32 tickerType = 12; //成交方向:1=BUY、2=SELL、3=NEUTRAL
optional double price = 13; //成交價
optional int64 volume = 14; //成交量(張)
optional double turnover = 15; //成交額
optional int32 optionType = 20; //期權類型:1=CALL、2=PUT
optional double strikePrice = 21; //行權價
optional string strikeTime = 22; //到期日
optional double strikeTimestamp = 23; //到期時間戳(Unix 秒)
optional int32 dte = 24; //距到期天數
optional double underlyingPrice = 30; //標的價格
optional double otm = 31; //價外比率(百分比)
optional double bidPrice = 32; //買一價
optional double askPrice = 33; //賣一價
optional double iv = 34; //隱含波動率(百分比)
optional int64 totalVolume = 35; //期權當日總成交量
optional int64 totalOpenInterest = 36; //期權當日總持倉量
optional double voRatio = 37; //量倉比(百分比)
optional double delta = 40; //Delta
optional double gamma = 41; //Gamma
optional double vega = 42; //Vega
optional double theta = 43; //Theta
optional double rho = 44; //Rho
optional int32 sentiment = 50; //市場情緒:1=BEARISH、2=BULLISH、3=NEUTRAL
repeated int32 orderTypeList = 51; //訂單類型列表:0=NORMAL、1=SWEEP、2=CROSS、4=FLOOR
optional int32 strategyType = 52; //策略類型:1=SINGLE_LEG、2=MULTI_LEG
optional string earningsTime = 60; //業績時間
optional int32 earningsPubType = 61; //業績發佈類型
repeated CorporateAction corporateActionList = 63; //企業行動列表
repeated Qot_Common.Security industryPlateList = 64; //行業板塊列表
repeated Qot_Common.Security conceptPlateList = 65; //概念板塊列表
}
message S2C
{
repeated EventItem eventList = 1; //異動列表
optional string nextPage = 2; //下一頁標記,空字符串表示沒有更多頁
optional int32 allCount = 3; //總條數
optional double updateTimestamp = 4; //數據更新時間戳
}
message Response
{
required int32 retType = 1 [default = -400]; //RetType,返回結果
optional string retMsg = 2;
optional int32 errCode = 3;
optional S2C s2c = 4;
}
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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
- 接口調用結果,結構參見 RetType
協議 ID
3307
Example
class Program : public FTSPI_Qot, public FTSPI_Conn
{
public:
Program() {
m_pQotApi = FTAPI::CreateQotApi();
m_pQotApi->RegisterQotSpi(this);
m_pQotApi->RegisterConnSpi(this);
}
~Program() {
if (m_pQotApi != nullptr) {
m_pQotApi->UnregisterQotSpi();
m_pQotApi->UnregisterConnSpi();
FTAPI::ReleaseQotApi(m_pQotApi);
m_pQotApi = nullptr;
}
}
void Start() {
m_pQotApi->InitConnect("127.0.0.1", 11111, false);
}
virtual void OnInitConnect(FTAPI_Conn* pConn, Futu::i64_t nErrCode, const char* strDesc) {
Qot_GetOptionEvent::Request req;
Qot_GetOptionEvent::C2S *c2s = req.mutable_c2s();
// TODO: 按 proto 填充 c2s 字段
m_GetOptionEventSerialNo = m_pQotApi->GetOptionEvent(req);
}
virtual void OnReply_GetOptionEvent(Futu::u32_t nSerialNo, const Qot_GetOptionEvent::Response &stRsp) {
if (nSerialNo != m_GetOptionEventSerialNo) return;
string resp_str;
ProtoBufToBodyData(stRsp, resp_str);
cout << UTF8ToLocal(resp_str) << endl;
}
protected:
FTAPI_Qot *m_pQotApi;
Futu::u32_t m_GetOptionEventSerialNo = 0;
};
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
29
30
31
32
33
34
35
36
37
38
39
40
getOptionEvent(qotGetOptionEvent)
介紹
獲取期權異動列表
參數
message EventIndicator
{
required int32 indicatorType = 1; //EventIndicatorType,篩選指標類型
optional Qot_OptionCommon.IndicatorValue indicatorValue = 2; //篩選指標值
}
message EventSort
{
required int32 indicatorType = 1; //排序指標類型
required bool isAsc = 2; //是否升序
}
message C2S
{
required int32 optionMarket = 1; //期權市場類型
optional int32 count = 2; //每頁數量[1,300]
optional string page = 3; //分頁標記,首次傳空字符串
repeated EventIndicator filterList = 4; //篩選條件列表
optional EventSort sort = 5; //排序
}
message Request
{
required C2S c2s = 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
- 返回
message CorporateAction
{
optional int32 actionType = 1; //企業行動類型
optional string actionTime = 2; //企業行動時間
}
message EventItem
{
optional Qot_Common.Security option = 1; //期權合約
optional Qot_Common.Security owner = 2; //標的股票
optional string symbol = 3; //標的顯示代碼
optional string fillTime = 10; //成交時間
optional double fillTimestamp = 11; //成交時間戳(Unix 秒)
optional int32 tickerType = 12; //成交方向:1=BUY、2=SELL、3=NEUTRAL
optional double price = 13; //成交價
optional int64 volume = 14; //成交量(張)
optional double turnover = 15; //成交額
optional int32 optionType = 20; //期權類型:1=CALL、2=PUT
optional double strikePrice = 21; //行權價
optional string strikeTime = 22; //到期日
optional double strikeTimestamp = 23; //到期時間戳(Unix 秒)
optional int32 dte = 24; //距到期天數
optional double underlyingPrice = 30; //標的價格
optional double otm = 31; //價外比率(百分比)
optional double bidPrice = 32; //買一價
optional double askPrice = 33; //賣一價
optional double iv = 34; //隱含波動率(百分比)
optional int64 totalVolume = 35; //期權當日總成交量
optional int64 totalOpenInterest = 36; //期權當日總持倉量
optional double voRatio = 37; //量倉比(百分比)
optional double delta = 40; //Delta
optional double gamma = 41; //Gamma
optional double vega = 42; //Vega
optional double theta = 43; //Theta
optional double rho = 44; //Rho
optional int32 sentiment = 50; //市場情緒:1=BEARISH、2=BULLISH、3=NEUTRAL
repeated int32 orderTypeList = 51; //訂單類型列表:0=NORMAL、1=SWEEP、2=CROSS、4=FLOOR
optional int32 strategyType = 52; //策略類型:1=SINGLE_LEG、2=MULTI_LEG
optional string earningsTime = 60; //業績時間
optional int32 earningsPubType = 61; //業績發佈類型
repeated CorporateAction corporateActionList = 63; //企業行動列表
repeated Qot_Common.Security industryPlateList = 64; //行業板塊列表
repeated Qot_Common.Security conceptPlateList = 65; //概念板塊列表
}
message S2C
{
repeated EventItem eventList = 1; //異動列表
optional string nextPage = 2; //下一頁標記,空字符串表示沒有更多頁
optional int32 allCount = 3; //總條數
optional double updateTimestamp = 4; //數據更新時間戳
}
message Response
{
required int32 retType = 1 [default = -400]; //RetType,返回結果
optional string retMsg = 2;
optional int32 errCode = 3;
optional S2C s2c = 4;
}
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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
- 接口調用結果,結構參見 RetType
協議 ID
3307
Example
import ftWebsocket from "futu-api";
import { Common, Qot_OptionCommon } from "futu-api/proto";
import beautify from "js-beautify";
function QotGetOptionEvent(){
const { RetType } = Common
const { OptionMarket } = Qot_OptionCommon
let [addr, port, enable_ssl, key] = ["127.0.0.1", 11112, false, ''];
let websocket = new ftWebsocket();
websocket.onlogin = (ret, msg)=>{
if (ret) {
const req = {
c2s: {
optionMarket: OptionMarket.OptionMarket_US_Security,
count: 5,
},
};
websocket.GetOptionEvent(req)
.then((res)=>{
let { errCode, retMsg, retType, s2c } = res
console.log("GetOptionEvent: errCode %d, retMsg %s, retType %d", errCode, retMsg, retType);
if(retType == RetType.RetType_Succeed){
let data = beautify(JSON.stringify(s2c), { indent_size: 2, space_in_empty_paren: true });
console.log(data);
}
})
.catch((error)=>{ console.log("error:", error); });
} else {
console.log("start error", msg);
}
};
websocket.start(addr, port, enable_ssl, key);
setTimeout(()=>{ websocket.stop(); process.exit(); }, 5000);
}
QotGetOptionEvent()
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
29
30
31
32
33
34
35
36
37
38
- Output
GetOptionEvent: errCode 0, retMsg , retType 0
{
"eventList": [
{
"option": { "market": 1, "code": "TLT260618C86000" },
"owner": { "market": 1, "code": "TLT" },
"symbol": "TLT",
"fillTime": "2026-06-12 16:14:00",
"fillTimestamp": 1781295240,
"tickerType": 2,
"price": 0.28,
"volume": 10000,
"turnover": 280000,
"optionType": 1,
"strikePrice": 86,
"strikeTime": "2026-06-18",
"strikeTimestamp": 1781759000,
"dte": 3,
"underlyingPrice": 85.77,
"otm": 0.268,
"bidPrice": 0.28,
"askPrice": 0.3,
"iv": 8.24,
"totalVolume": 70108,
"totalOpenInterest": 88849,
"voRatio": 0.78906,
"delta": 0.424382,
"gamma": 0.432194,
"vega": 0.043077,
"theta": -0.034441,
"rho": 0.00594,
"sentiment": 2,
"orderTypeList": [2, 1],
"strategyType": 1
}
],
"allCount": 164620
}
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
29
30
31
32
33
34
35
36
37
38
接口限制
- 30 秒內最多請求 60 次期權異動接口(支持分頁的接口,僅首次調用納入統計)
- Python
- Proto
- C#
- Java
- C++
- JavaScript
get_option_event(option_market, count=None, page=None, filter_list=None, sort=None)
介紹
獲取期權異動列表,返回大單成交、掃單等期權異動記錄,支持按標的、合約屬性、成交信息、希臘值等多維度篩選和排序。
參數
參數 類型 說明 option_market OptionMarket 期權市場類型 US_SECURITY=美股股票期權、US_INDEX=美股指數期權、HK_SECURITY=港股股票期權、HK_INDEX=港股指數期權count int 每頁數量 範圍 [1,300]page str 分頁標記 首次傳空字符串,翻頁傳上次返回的 next_pagefilter_list list[EventFilter] 篩選條件列表 多條件為 AND 關係。支持按標的(OWNER_LIST)、行業板塊、期權類型(CALL/PUT)、成交方向、成交量、成交額、IV、Delta 等篩選sort EventSort 排序 默認按時間降序返回
參數 類型 說明 ret RET_CODE 接口調用結果 data dict 當 ret == RET_OK,返回異動數據 str 當 ret != RET_OK,返回錯誤描述 data 字典包含:
字段 類型 說明 event_list pandas.DataFrame 異動列表 next_page str 下一頁標記 空字符串表示沒有更多頁all_count int 總條數 update_timestamp float 數據更新時間戳 event_list DataFrame 字段:
字段 類型 說明 option_code str 期權合約代碼 owner_code str 標的股票代碼 symbol str 標的 display code(如 TSLA) fill_time str 成交時間 fill_timestamp float 成交時間戳(Unix 秒) ticker_type str 成交方向 BUY/SELL/NEUTRALprice float 成交價 volume int 成交量(張) turnover float 成交額 option_type str 期權類型 CALL/PUTstrike_price float 行權價 strike_time str 到期日 strike_timestamp float 到期時間戳(Unix 秒) dte int 距到期天數 underlying_price float 標的價格 otm float 價外比率(百分比) bid_price float 買一價 ask_price float 賣一價 iv float 隱含波動率(百分比) total_volume int 期權當日總成交量 total_open_interest int 期權當日總持倉量 vo_ratio float 量倉比(百分比) delta float Delta gamma float Gamma vega float Vega theta float Theta rho float Rho sentiment str 市場情緒 BEARISH/BULLISH/NEUTRALorder_type_list list 訂單類型列表 NORMAL/SWEEP/CROSS/FLOORstrategy_type str 策略類型 SINGLE_LEG/MULTI_LEGearnings_time str 業績時間 earnings_pub_type int 業績發佈類型 corporate_action_list list 企業行動列表 industry_plate_list list 行業板塊列表 concept_plate_list list 概念板塊列表
Example
from moomoo import *
quote_ctx = OpenQuoteContext(host='127.0.0.1', port=11111)
ret, data = quote_ctx.get_option_event(OptionMarket.US_SECURITY, count=5)
if ret == RET_OK:
print(data['event_list'])
print('all_count:', data['all_count'])
else:
print('error:', data)
quote_ctx.close()
2
3
4
5
6
7
8
9
10
11
12
- Output
option_code owner_code symbol fill_time fill_timestamp ticker_type price volume turnover option_type strike_price strike_time strike_timestamp dte underlying_price otm bid_price ask_price iv total_volume total_open_interest vo_ratio delta gamma vega theta rho sentiment order_type_list strategy_type earnings_time earnings_pub_type corporate_action_list industry_plate_list concept_plate_list
0 US.TLT260618C86000 US.TLT TLT 2026-06-12 16:14:00 1.781295e+09 SELL 0.280000 10000 280000.0 CALL 86.0 2026-06-18 1.781759e+09 3 85.77 0.268 0.28 0.30 8.240 70108 88849 0.78906 0.424382 0.432194 0.043077 -0.034441 0.005940 BEARISH [SWEEP, NORMAL] SINGLE_LEG N/A N/A N/A N/A N/A
1 US.TLT260618C86000 US.TLT TLT 2026-06-12 16:13:18 1.781295e+09 SELL 0.280000 7821 218988.0 CALL 86.0 2026-06-18 1.781759e+09 3 85.77 0.268 0.28 0.30 8.240 60104 88849 0.67647 0.424382 0.432194 0.043077 -0.034441 0.005940 BEARISH [SWEEP, NORMAL] SINGLE_LEG N/A N/A N/A N/A N/A
2 US.IWM260618P285000 US.IWM IWM 2026-06-12 16:07:53 1.781295e+09 SELL 1.320000 3002 396264.0 PUT 285.0 2026-06-18 1.781759e+09 3 292.96 2.717 1.32 1.35 28.323 57418 26731 2.14799 -0.214110 0.027402 0.109475 -0.256980 -0.009801 BULLISH [SWEEP, NORMAL] SINGLE_LEG N/A N/A [{'action_type': 7, 'action_time': '2026-06-15', 'action_timestamp': ...}] N/A N/A
3 US.SPY260717P706000 US.SPY SPY 2026-06-12 16:04:46 1.781295e+09 BUY 4.333523 3872 1677940.0 PUT 706.0 2026-07-17 1.784264e+09 32 741.77 4.822 4.29 4.35 19.000 22269 8169 2.72603 -0.177726 0.005982 0.596630 -0.150480 -0.113947 BEARISH [SWEEP, NORMAL] SINGLE_LEG N/A N/A N/A N/A [US.LIST2153]
4 US.SPY260717P704000 US.SPY SPY 2026-06-12 16:04:26 1.781295e+09 SELL 4.060235 6767 2747561.0 PUT 704.0 2026-07-17 1.784264e+09 32 741.77 5.091 4.05 4.10 19.214 17712 7842 2.25860 -0.167963 0.005705 0.575554 -0.147087 -0.107775 BULLISH [NORMAL] SINGLE_LEG N/A N/A N/A N/A [US.LIST2153]
all_count: 164620
2
3
4
5
6
7
# Qot_GetOptionEvent.proto
介紹
獲取期權異動列表
參數
message EventIndicator
{
required int32 indicatorType = 1; //EventIndicatorType,篩選指標類型
optional Qot_OptionCommon.IndicatorValue indicatorValue = 2; //篩選指標值
}
message EventSort
{
required int32 indicatorType = 1; //排序指標類型
required bool isAsc = 2; //是否升序
}
message C2S
{
required int32 optionMarket = 1; //期權市場類型
optional int32 count = 2; //每頁數量[1,300]
optional string page = 3; //分頁標記,首次傳空字符串
repeated EventIndicator filterList = 4; //篩選條件列表
optional EventSort sort = 5; //排序
}
message Request
{
required C2S c2s = 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
- 返回
message CorporateAction
{
optional int32 actionType = 1; //企業行動類型
optional string actionTime = 2; //企業行動時間
}
message EventItem
{
optional Qot_Common.Security option = 1; //期權合約
optional Qot_Common.Security owner = 2; //標的股票
optional string symbol = 3; //標的顯示代碼
optional string fillTime = 10; //成交時間
optional double fillTimestamp = 11; //成交時間戳(Unix 秒)
optional int32 tickerType = 12; //成交方向:1=BUY、2=SELL、3=NEUTRAL
optional double price = 13; //成交價
optional int64 volume = 14; //成交量(張)
optional double turnover = 15; //成交額
optional int32 optionType = 20; //期權類型:1=CALL、2=PUT
optional double strikePrice = 21; //行權價
optional string strikeTime = 22; //到期日
optional double strikeTimestamp = 23; //到期時間戳(Unix 秒)
optional int32 dte = 24; //距到期天數
optional double underlyingPrice = 30; //標的價格
optional double otm = 31; //價外比率(百分比)
optional double bidPrice = 32; //買一價
optional double askPrice = 33; //賣一價
optional double iv = 34; //隱含波動率(百分比)
optional int64 totalVolume = 35; //期權當日總成交量
optional int64 totalOpenInterest = 36; //期權當日總持倉量
optional double voRatio = 37; //量倉比(百分比)
optional double delta = 40; //Delta
optional double gamma = 41; //Gamma
optional double vega = 42; //Vega
optional double theta = 43; //Theta
optional double rho = 44; //Rho
optional int32 sentiment = 50; //市場情緒:1=BEARISH、2=BULLISH、3=NEUTRAL
repeated int32 orderTypeList = 51; //訂單類型列表:0=NORMAL、1=SWEEP、2=CROSS、4=FLOOR
optional int32 strategyType = 52; //策略類型:1=SINGLE_LEG、2=MULTI_LEG
optional string earningsTime = 60; //業績時間
optional int32 earningsPubType = 61; //業績發佈類型
repeated CorporateAction corporateActionList = 63; //企業行動列表
repeated Qot_Common.Security industryPlateList = 64; //行業板塊列表
repeated Qot_Common.Security conceptPlateList = 65; //概念板塊列表
}
message S2C
{
repeated EventItem eventList = 1; //異動列表
optional string nextPage = 2; //下一頁標記,空字符串表示沒有更多頁
optional int32 allCount = 3; //總條數
optional double updateTimestamp = 4; //數據更新時間戳
}
message Response
{
required int32 retType = 1 [default = -400]; //RetType,返回結果
optional string retMsg = 2;
optional int32 errCode = 3;
optional S2C s2c = 4;
}
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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
- 接口調用結果,結構參見 RetType
協議 ID
3307
uint GetOptionEvent(Qot_GetOptionEvent.Request req); virtual void OnReply_GetOptionEvent(MMAPI_Conn client, uint nSerialNo, Qot_GetOptionEvent.Response rsp);
介紹
獲取期權異動列表
參數
message EventIndicator
{
required int32 indicatorType = 1; //EventIndicatorType,篩選指標類型
optional Qot_OptionCommon.IndicatorValue indicatorValue = 2; //篩選指標值
}
message EventSort
{
required int32 indicatorType = 1; //排序指標類型
required bool isAsc = 2; //是否升序
}
message C2S
{
required int32 optionMarket = 1; //期權市場類型
optional int32 count = 2; //每頁數量[1,300]
optional string page = 3; //分頁標記,首次傳空字符串
repeated EventIndicator filterList = 4; //篩選條件列表
optional EventSort sort = 5; //排序
}
message Request
{
required C2S c2s = 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
- 返回
message CorporateAction
{
optional int32 actionType = 1; //企業行動類型
optional string actionTime = 2; //企業行動時間
}
message EventItem
{
optional Qot_Common.Security option = 1; //期權合約
optional Qot_Common.Security owner = 2; //標的股票
optional string symbol = 3; //標的顯示代碼
optional string fillTime = 10; //成交時間
optional double fillTimestamp = 11; //成交時間戳(Unix 秒)
optional int32 tickerType = 12; //成交方向:1=BUY、2=SELL、3=NEUTRAL
optional double price = 13; //成交價
optional int64 volume = 14; //成交量(張)
optional double turnover = 15; //成交額
optional int32 optionType = 20; //期權類型:1=CALL、2=PUT
optional double strikePrice = 21; //行權價
optional string strikeTime = 22; //到期日
optional double strikeTimestamp = 23; //到期時間戳(Unix 秒)
optional int32 dte = 24; //距到期天數
optional double underlyingPrice = 30; //標的價格
optional double otm = 31; //價外比率(百分比)
optional double bidPrice = 32; //買一價
optional double askPrice = 33; //賣一價
optional double iv = 34; //隱含波動率(百分比)
optional int64 totalVolume = 35; //期權當日總成交量
optional int64 totalOpenInterest = 36; //期權當日總持倉量
optional double voRatio = 37; //量倉比(百分比)
optional double delta = 40; //Delta
optional double gamma = 41; //Gamma
optional double vega = 42; //Vega
optional double theta = 43; //Theta
optional double rho = 44; //Rho
optional int32 sentiment = 50; //市場情緒:1=BEARISH、2=BULLISH、3=NEUTRAL
repeated int32 orderTypeList = 51; //訂單類型列表:0=NORMAL、1=SWEEP、2=CROSS、4=FLOOR
optional int32 strategyType = 52; //策略類型:1=SINGLE_LEG、2=MULTI_LEG
optional string earningsTime = 60; //業績時間
optional int32 earningsPubType = 61; //業績發佈類型
repeated CorporateAction corporateActionList = 63; //企業行動列表
repeated Qot_Common.Security industryPlateList = 64; //行業板塊列表
repeated Qot_Common.Security conceptPlateList = 65; //概念板塊列表
}
message S2C
{
repeated EventItem eventList = 1; //異動列表
optional string nextPage = 2; //下一頁標記,空字符串表示沒有更多頁
optional int32 allCount = 3; //總條數
optional double updateTimestamp = 4; //數據更新時間戳
}
message Response
{
required int32 retType = 1 [default = -400]; //RetType,返回結果
optional string retMsg = 2;
optional int32 errCode = 3;
optional S2C s2c = 4;
}
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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
- 接口調用結果,結構參見 RetType
協議 ID
3307
int getOptionEvent(Qot_GetOptionEvent.Request req) onReply_GetOptionEvent(MMAPI_Conn client, int nSerialNo, Qot_GetOptionEvent.Response rsp)
介紹
獲取期權異動列表
參數
message EventIndicator
{
required int32 indicatorType = 1; //EventIndicatorType,篩選指標類型
optional Qot_OptionCommon.IndicatorValue indicatorValue = 2; //篩選指標值
}
message EventSort
{
required int32 indicatorType = 1; //排序指標類型
required bool isAsc = 2; //是否升序
}
message C2S
{
required int32 optionMarket = 1; //期權市場類型
optional int32 count = 2; //每頁數量[1,300]
optional string page = 3; //分頁標記,首次傳空字符串
repeated EventIndicator filterList = 4; //篩選條件列表
optional EventSort sort = 5; //排序
}
message Request
{
required C2S c2s = 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
- 返回
message CorporateAction
{
optional int32 actionType = 1; //企業行動類型
optional string actionTime = 2; //企業行動時間
}
message EventItem
{
optional Qot_Common.Security option = 1; //期權合約
optional Qot_Common.Security owner = 2; //標的股票
optional string symbol = 3; //標的顯示代碼
optional string fillTime = 10; //成交時間
optional double fillTimestamp = 11; //成交時間戳(Unix 秒)
optional int32 tickerType = 12; //成交方向:1=BUY、2=SELL、3=NEUTRAL
optional double price = 13; //成交價
optional int64 volume = 14; //成交量(張)
optional double turnover = 15; //成交額
optional int32 optionType = 20; //期權類型:1=CALL、2=PUT
optional double strikePrice = 21; //行權價
optional string strikeTime = 22; //到期日
optional double strikeTimestamp = 23; //到期時間戳(Unix 秒)
optional int32 dte = 24; //距到期天數
optional double underlyingPrice = 30; //標的價格
optional double otm = 31; //價外比率(百分比)
optional double bidPrice = 32; //買一價
optional double askPrice = 33; //賣一價
optional double iv = 34; //隱含波動率(百分比)
optional int64 totalVolume = 35; //期權當日總成交量
optional int64 totalOpenInterest = 36; //期權當日總持倉量
optional double voRatio = 37; //量倉比(百分比)
optional double delta = 40; //Delta
optional double gamma = 41; //Gamma
optional double vega = 42; //Vega
optional double theta = 43; //Theta
optional double rho = 44; //Rho
optional int32 sentiment = 50; //市場情緒:1=BEARISH、2=BULLISH、3=NEUTRAL
repeated int32 orderTypeList = 51; //訂單類型列表:0=NORMAL、1=SWEEP、2=CROSS、4=FLOOR
optional int32 strategyType = 52; //策略類型:1=SINGLE_LEG、2=MULTI_LEG
optional string earningsTime = 60; //業績時間
optional int32 earningsPubType = 61; //業績發佈類型
repeated CorporateAction corporateActionList = 63; //企業行動列表
repeated Qot_Common.Security industryPlateList = 64; //行業板塊列表
repeated Qot_Common.Security conceptPlateList = 65; //概念板塊列表
}
message S2C
{
repeated EventItem eventList = 1; //異動列表
optional string nextPage = 2; //下一頁標記,空字符串表示沒有更多頁
optional int32 allCount = 3; //總條數
optional double updateTimestamp = 4; //數據更新時間戳
}
message Response
{
required int32 retType = 1 [default = -400]; //RetType,返回結果
optional string retMsg = 2;
optional int32 errCode = 3;
optional S2C s2c = 4;
}
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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
- 接口調用結果,結構參見 RetType
協議 ID
3307
Moomoo::u32_t GetOptionEvent(const Qot_GetOptionEvent::Request &stReq);
virtual void OnReply_GetOptionEvent(Moomoo::u32_t nSerialNo, const Qot_GetOptionEvent::Response &stRsp) = 0;
介紹
獲取期權異動列表
參數
message EventIndicator
{
required int32 indicatorType = 1; //EventIndicatorType,篩選指標類型
optional Qot_OptionCommon.IndicatorValue indicatorValue = 2; //篩選指標值
}
message EventSort
{
required int32 indicatorType = 1; //排序指標類型
required bool isAsc = 2; //是否升序
}
message C2S
{
required int32 optionMarket = 1; //期權市場類型
optional int32 count = 2; //每頁數量[1,300]
optional string page = 3; //分頁標記,首次傳空字符串
repeated EventIndicator filterList = 4; //篩選條件列表
optional EventSort sort = 5; //排序
}
message Request
{
required C2S c2s = 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
- 返回
message CorporateAction
{
optional int32 actionType = 1; //企業行動類型
optional string actionTime = 2; //企業行動時間
}
message EventItem
{
optional Qot_Common.Security option = 1; //期權合約
optional Qot_Common.Security owner = 2; //標的股票
optional string symbol = 3; //標的顯示代碼
optional string fillTime = 10; //成交時間
optional double fillTimestamp = 11; //成交時間戳(Unix 秒)
optional int32 tickerType = 12; //成交方向:1=BUY、2=SELL、3=NEUTRAL
optional double price = 13; //成交價
optional int64 volume = 14; //成交量(張)
optional double turnover = 15; //成交額
optional int32 optionType = 20; //期權類型:1=CALL、2=PUT
optional double strikePrice = 21; //行權價
optional string strikeTime = 22; //到期日
optional double strikeTimestamp = 23; //到期時間戳(Unix 秒)
optional int32 dte = 24; //距到期天數
optional double underlyingPrice = 30; //標的價格
optional double otm = 31; //價外比率(百分比)
optional double bidPrice = 32; //買一價
optional double askPrice = 33; //賣一價
optional double iv = 34; //隱含波動率(百分比)
optional int64 totalVolume = 35; //期權當日總成交量
optional int64 totalOpenInterest = 36; //期權當日總持倉量
optional double voRatio = 37; //量倉比(百分比)
optional double delta = 40; //Delta
optional double gamma = 41; //Gamma
optional double vega = 42; //Vega
optional double theta = 43; //Theta
optional double rho = 44; //Rho
optional int32 sentiment = 50; //市場情緒:1=BEARISH、2=BULLISH、3=NEUTRAL
repeated int32 orderTypeList = 51; //訂單類型列表:0=NORMAL、1=SWEEP、2=CROSS、4=FLOOR
optional int32 strategyType = 52; //策略類型:1=SINGLE_LEG、2=MULTI_LEG
optional string earningsTime = 60; //業績時間
optional int32 earningsPubType = 61; //業績發佈類型
repeated CorporateAction corporateActionList = 63; //企業行動列表
repeated Qot_Common.Security industryPlateList = 64; //行業板塊列表
repeated Qot_Common.Security conceptPlateList = 65; //概念板塊列表
}
message S2C
{
repeated EventItem eventList = 1; //異動列表
optional string nextPage = 2; //下一頁標記,空字符串表示沒有更多頁
optional int32 allCount = 3; //總條數
optional double updateTimestamp = 4; //數據更新時間戳
}
message Response
{
required int32 retType = 1 [default = -400]; //RetType,返回結果
optional string retMsg = 2;
optional int32 errCode = 3;
optional S2C s2c = 4;
}
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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
- 接口調用結果,結構參見 RetType
協議 ID
3307
Example
class Program : public MMSPI_Qot, public MMSPI_Conn
{
public:
Program() {
m_pQotApi = MMAPI::CreateQotApi();
m_pQotApi->RegisterQotSpi(this);
m_pQotApi->RegisterConnSpi(this);
}
~Program() {
if (m_pQotApi != nullptr) {
m_pQotApi->UnregisterQotSpi();
m_pQotApi->UnregisterConnSpi();
MMAPI::ReleaseQotApi(m_pQotApi);
m_pQotApi = nullptr;
}
}
void Start() {
m_pQotApi->InitConnect("127.0.0.1", 11111, false);
}
virtual void OnInitConnect(MMAPI_Conn* pConn, Moomoo::i64_t nErrCode, const char* strDesc) {
Qot_GetOptionEvent::Request req;
Qot_GetOptionEvent::C2S *c2s = req.mutable_c2s();
// TODO: 按 proto 填充 c2s 字段
m_GetOptionEventSerialNo = m_pQotApi->GetOptionEvent(req);
}
virtual void OnReply_GetOptionEvent(Moomoo::u32_t nSerialNo, const Qot_GetOptionEvent::Response &stRsp) {
if (nSerialNo != m_GetOptionEventSerialNo) return;
string resp_str;
ProtoBufToBodyData(stRsp, resp_str);
cout << UTF8ToLocal(resp_str) << endl;
}
protected:
MMAPI_Qot *m_pQotApi;
Moomoo::u32_t m_GetOptionEventSerialNo = 0;
};
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
29
30
31
32
33
34
35
36
37
38
39
40
getOptionEvent(qotGetOptionEvent)
介紹
獲取期權異動列表
參數
message EventIndicator
{
required int32 indicatorType = 1; //EventIndicatorType,篩選指標類型
optional Qot_OptionCommon.IndicatorValue indicatorValue = 2; //篩選指標值
}
message EventSort
{
required int32 indicatorType = 1; //排序指標類型
required bool isAsc = 2; //是否升序
}
message C2S
{
required int32 optionMarket = 1; //期權市場類型
optional int32 count = 2; //每頁數量[1,300]
optional string page = 3; //分頁標記,首次傳空字符串
repeated EventIndicator filterList = 4; //篩選條件列表
optional EventSort sort = 5; //排序
}
message Request
{
required C2S c2s = 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
- 返回
message CorporateAction
{
optional int32 actionType = 1; //企業行動類型
optional string actionTime = 2; //企業行動時間
}
message EventItem
{
optional Qot_Common.Security option = 1; //期權合約
optional Qot_Common.Security owner = 2; //標的股票
optional string symbol = 3; //標的顯示代碼
optional string fillTime = 10; //成交時間
optional double fillTimestamp = 11; //成交時間戳(Unix 秒)
optional int32 tickerType = 12; //成交方向:1=BUY、2=SELL、3=NEUTRAL
optional double price = 13; //成交價
optional int64 volume = 14; //成交量(張)
optional double turnover = 15; //成交額
optional int32 optionType = 20; //期權類型:1=CALL、2=PUT
optional double strikePrice = 21; //行權價
optional string strikeTime = 22; //到期日
optional double strikeTimestamp = 23; //到期時間戳(Unix 秒)
optional int32 dte = 24; //距到期天數
optional double underlyingPrice = 30; //標的價格
optional double otm = 31; //價外比率(百分比)
optional double bidPrice = 32; //買一價
optional double askPrice = 33; //賣一價
optional double iv = 34; //隱含波動率(百分比)
optional int64 totalVolume = 35; //期權當日總成交量
optional int64 totalOpenInterest = 36; //期權當日總持倉量
optional double voRatio = 37; //量倉比(百分比)
optional double delta = 40; //Delta
optional double gamma = 41; //Gamma
optional double vega = 42; //Vega
optional double theta = 43; //Theta
optional double rho = 44; //Rho
optional int32 sentiment = 50; //市場情緒:1=BEARISH、2=BULLISH、3=NEUTRAL
repeated int32 orderTypeList = 51; //訂單類型列表:0=NORMAL、1=SWEEP、2=CROSS、4=FLOOR
optional int32 strategyType = 52; //策略類型:1=SINGLE_LEG、2=MULTI_LEG
optional string earningsTime = 60; //業績時間
optional int32 earningsPubType = 61; //業績發佈類型
repeated CorporateAction corporateActionList = 63; //企業行動列表
repeated Qot_Common.Security industryPlateList = 64; //行業板塊列表
repeated Qot_Common.Security conceptPlateList = 65; //概念板塊列表
}
message S2C
{
repeated EventItem eventList = 1; //異動列表
optional string nextPage = 2; //下一頁標記,空字符串表示沒有更多頁
optional int32 allCount = 3; //總條數
optional double updateTimestamp = 4; //數據更新時間戳
}
message Response
{
required int32 retType = 1 [default = -400]; //RetType,返回結果
optional string retMsg = 2;
optional int32 errCode = 3;
optional S2C s2c = 4;
}
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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
- 接口調用結果,結構參見 RetType
協議 ID
3307
Example
import mmWebsocket from "moomoo-api";
import { Common, Qot_OptionCommon } from "moomoo-api/proto";
import beautify from "js-beautify";
function QotGetOptionEvent(){
const { RetType } = Common
const { OptionMarket } = Qot_OptionCommon
let [addr, port, enable_ssl, key] = ["127.0.0.1", 11112, false, ''];
let websocket = new mmWebsocket();
websocket.onlogin = (ret, msg)=>{
if (ret) {
const req = {
c2s: {
optionMarket: OptionMarket.OptionMarket_US_Security,
count: 5,
},
};
websocket.GetOptionEvent(req)
.then((res)=>{
let { errCode, retMsg, retType, s2c } = res
console.log("GetOptionEvent: errCode %d, retMsg %s, retType %d", errCode, retMsg, retType);
if(retType == RetType.RetType_Succeed){
let data = beautify(JSON.stringify(s2c), { indent_size: 2, space_in_empty_paren: true });
console.log(data);
}
})
.catch((error)=>{ console.log("error:", error); });
} else {
console.log("start error", msg);
}
};
websocket.start(addr, port, enable_ssl, key);
setTimeout(()=>{ websocket.stop(); process.exit(); }, 5000);
}
QotGetOptionEvent()
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
29
30
31
32
33
34
35
36
37
38
- Output
GetOptionEvent: errCode 0, retMsg , retType 0
{
"eventList": [
{
"option": { "market": 1, "code": "TLT260618C86000" },
"owner": { "market": 1, "code": "TLT" },
"symbol": "TLT",
"fillTime": "2026-06-12 16:14:00",
"fillTimestamp": 1781295240,
"tickerType": 2,
"price": 0.28,
"volume": 10000,
"turnover": 280000,
"optionType": 1,
"strikePrice": 86,
"strikeTime": "2026-06-18",
"strikeTimestamp": 1781759000,
"dte": 3,
"underlyingPrice": 85.77,
"otm": 0.268,
"bidPrice": 0.28,
"askPrice": 0.3,
"iv": 8.24,
"totalVolume": 70108,
"totalOpenInterest": 88849,
"voRatio": 0.78906,
"delta": 0.424382,
"gamma": 0.432194,
"vega": 0.043077,
"theta": -0.034441,
"rho": 0.00594,
"sentiment": 2,
"orderTypeList": [2, 1],
"strategyType": 1
}
],
"allCount": 164620
}
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
29
30
31
32
33
34
35
36
37
38
接口限制
- 30 秒內最多請求 60 次期權異動接口(支持分頁的接口,僅首次調用納入統計)