# Option Unusual Activity
- Python
- Proto
- C#
- Java
- C++
- JavaScript
get_option_event(option_market, count=None, page=None, filter_list=None, sort=None)
Description
Get option unusual activity list, returns records of large trades, sweeps, and other unusual option activities, with multi-dimensional filtering and sorting by underlying, contract attributes, trade info, Greeks, etc.
Parameters
Parameter Type Description option_market OptionMarket Option market type US_SECURITY=US equity options, US_INDEX=US index options, HK_SECURITY=HK equity options, HK_INDEX=HK index optionscount int Page size Range [1,300]page str Pagination marker Pass empty string for the first request, pass the previously returned next_page for subsequent pagesfilter_list list[EventFilter] Filter conditions list Multiple conditions are combined with AND logic. Supports filtering by underlying (OWNER_LIST), industry sector, option type (CALL/PUT), trade direction, volume, turnover, IV, Delta, etc.sort EventSort Sort order Default sorted by time in descending orderReturns
Parameter Type Description ret RET_CODE Interface call result data dict When ret == RET_OK, returns unusual activity data str When ret != RET_OK, returns error description data dictionary contains:
Field Type Description event_list pandas.DataFrame Unusual activity list next_page str Next page marker Empty string means no more pagesall_count int Total count update_timestamp float Data update timestamp event_list DataFrame fields:
Field Type Description option_code str Option contract code owner_code str Underlying stock code symbol str Underlying display code (e.g., TSLA) fill_time str Fill time fill_timestamp float Fill timestamp (Unix seconds) ticker_type str Trade direction BUY/SELL/NEUTRALprice float Fill price volume int Volume (contracts) turnover float Turnover option_type str Option type CALL/PUTstrike_price float Strike price strike_time str Expiration date strike_timestamp float Expiration timestamp (Unix seconds) dte int Days to expiration underlying_price float Underlying price otm float Out-of-the-money ratio (percentage) bid_price float Best bid price ask_price float Best ask price iv float Implied volatility (percentage) total_volume int Option total daily volume total_open_interest int Option total daily open interest vo_ratio float Volume/OI ratio (percentage) delta float Delta gamma float Gamma vega float Vega theta float Theta rho float Rho sentiment str Market sentiment BEARISH/BULLISH/NEUTRALorder_type_list list Order type list NORMAL/SWEEP/CROSS/FLOORstrategy_type str Strategy type SINGLE_LEG/MULTI_LEGearnings_time str Earnings time earnings_pub_type int Earnings publish type corporate_action_list list Corporate action list industry_plate_list list Industry plate list concept_plate_list list Concept plate 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
Description
Get option unusual activity list
Parameters
message EventIndicator
{
required int32 indicatorType = 1; //EventIndicatorType, filter indicator type
optional Qot_OptionCommon.IndicatorValue indicatorValue = 2; //Filter indicator value
}
message EventSort
{
required int32 indicatorType = 1; //Sort indicator type
required bool isAsc = 2; //Whether ascending order
}
message C2S
{
required int32 optionMarket = 1; //Option market type
optional int32 count = 2; //Page size [1,300]
optional string page = 3; //Pagination marker, empty string for first request
repeated EventIndicator filterList = 4; //Filter conditions list
optional EventSort sort = 5; //Sort order
}
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
- Returns
message CorporateAction
{
optional int32 actionType = 1; //Corporate action type
optional string actionTime = 2; //Corporate action time
}
message EventItem
{
optional Qot_Common.Security option = 1; //Option contract security
optional Qot_Common.Security owner = 2; //Underlying security
optional string symbol = 3; //Underlying display symbol
optional string fillTime = 10; //Fill time
optional double fillTimestamp = 11; //Fill timestamp (Unix seconds)
optional int32 tickerType = 12; //Trade direction: 1=BUY, 2=SELL, 3=NEUTRAL
optional double price = 13; //Fill price
optional int64 volume = 14; //Volume (contracts)
optional double turnover = 15; //Turnover
optional int32 optionType = 20; //Option type: 1=CALL, 2=PUT
optional double strikePrice = 21; //Strike price
optional string strikeTime = 22; //Expiration date
optional double strikeTimestamp = 23; //Expiration timestamp (Unix seconds)
optional int32 dte = 24; //Days to expiration
optional double underlyingPrice = 30; //Underlying price
optional double otm = 31; //Out-of-the-money ratio (percentage)
optional double bidPrice = 32; //Best bid price
optional double askPrice = 33; //Best ask price
optional double iv = 34; //Implied volatility (percentage)
optional int64 totalVolume = 35; //Option total daily volume
optional int64 totalOpenInterest = 36; //Option total daily open interest
optional double voRatio = 37; //Volume/OI ratio (percentage)
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; //Market sentiment: 1=BEARISH, 2=BULLISH, 3=NEUTRAL
repeated int32 orderTypeList = 51; //Order type list: 0=NORMAL, 1=SWEEP, 2=CROSS, 4=FLOOR
optional int32 strategyType = 52; //Strategy type: 1=SINGLE_LEG, 2=MULTI_LEG
optional string earningsTime = 60; //Earnings time
optional int32 earningsPubType = 61; //Earnings publish type
repeated CorporateAction corporateActionList = 63; //Corporate action list
repeated Qot_Common.Security industryPlateList = 64; //Industry plate list
repeated Qot_Common.Security conceptPlateList = 65; //Concept plate list
}
message S2C
{
repeated EventItem eventList = 1; //Unusual activity list
optional string nextPage = 2; //Next page marker, empty string means no more pages
optional int32 allCount = 3; //Total count
optional double updateTimestamp = 4; //Data update timestamp
}
message Response
{
required int32 retType = 1 [default = -400]; //RetType, return result
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
- Interface call result, see RetType
Protocol ID
3307
uint GetOptionEvent(Qot_GetOptionEvent.Request req); virtual void OnReply_GetOptionEvent(FTAPI_Conn client, uint nSerialNo, Qot_GetOptionEvent.Response rsp);
Description
Get option unusual activity list
Parameters
message EventIndicator
{
required int32 indicatorType = 1; //EventIndicatorType, filter indicator type
optional Qot_OptionCommon.IndicatorValue indicatorValue = 2; //Filter indicator value
}
message EventSort
{
required int32 indicatorType = 1; //Sort indicator type
required bool isAsc = 2; //Whether ascending order
}
message C2S
{
required int32 optionMarket = 1; //Option market type
optional int32 count = 2; //Page size [1,300]
optional string page = 3; //Pagination marker, empty string for first request
repeated EventIndicator filterList = 4; //Filter conditions list
optional EventSort sort = 5; //Sort order
}
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
- Returns
message CorporateAction
{
optional int32 actionType = 1; //Corporate action type
optional string actionTime = 2; //Corporate action time
}
message EventItem
{
optional Qot_Common.Security option = 1; //Option contract security
optional Qot_Common.Security owner = 2; //Underlying security
optional string symbol = 3; //Underlying display symbol
optional string fillTime = 10; //Fill time
optional double fillTimestamp = 11; //Fill timestamp (Unix seconds)
optional int32 tickerType = 12; //Trade direction: 1=BUY, 2=SELL, 3=NEUTRAL
optional double price = 13; //Fill price
optional int64 volume = 14; //Volume (contracts)
optional double turnover = 15; //Turnover
optional int32 optionType = 20; //Option type: 1=CALL, 2=PUT
optional double strikePrice = 21; //Strike price
optional string strikeTime = 22; //Expiration date
optional double strikeTimestamp = 23; //Expiration timestamp (Unix seconds)
optional int32 dte = 24; //Days to expiration
optional double underlyingPrice = 30; //Underlying price
optional double otm = 31; //Out-of-the-money ratio (percentage)
optional double bidPrice = 32; //Best bid price
optional double askPrice = 33; //Best ask price
optional double iv = 34; //Implied volatility (percentage)
optional int64 totalVolume = 35; //Option total daily volume
optional int64 totalOpenInterest = 36; //Option total daily open interest
optional double voRatio = 37; //Volume/OI ratio (percentage)
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; //Market sentiment: 1=BEARISH, 2=BULLISH, 3=NEUTRAL
repeated int32 orderTypeList = 51; //Order type list: 0=NORMAL, 1=SWEEP, 2=CROSS, 4=FLOOR
optional int32 strategyType = 52; //Strategy type: 1=SINGLE_LEG, 2=MULTI_LEG
optional string earningsTime = 60; //Earnings time
optional int32 earningsPubType = 61; //Earnings publish type
repeated CorporateAction corporateActionList = 63; //Corporate action list
repeated Qot_Common.Security industryPlateList = 64; //Industry plate list
repeated Qot_Common.Security conceptPlateList = 65; //Concept plate list
}
message S2C
{
repeated EventItem eventList = 1; //Unusual activity list
optional string nextPage = 2; //Next page marker, empty string means no more pages
optional int32 allCount = 3; //Total count
optional double updateTimestamp = 4; //Data update timestamp
}
message Response
{
required int32 retType = 1 [default = -400]; //RetType, return result
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
- Interface call result, see RetType
协议 ID
3307
int getOptionEvent(Qot_GetOptionEvent.Request req) onReply_GetOptionEvent(FTAPI_Conn client, int nSerialNo, Qot_GetOptionEvent.Response rsp)
Description
Get option unusual activity list
Parameters
message EventIndicator
{
required int32 indicatorType = 1; //EventIndicatorType, filter indicator type
optional Qot_OptionCommon.IndicatorValue indicatorValue = 2; //Filter indicator value
}
message EventSort
{
required int32 indicatorType = 1; //Sort indicator type
required bool isAsc = 2; //Whether ascending order
}
message C2S
{
required int32 optionMarket = 1; //Option market type
optional int32 count = 2; //Page size [1,300]
optional string page = 3; //Pagination marker, empty string for first request
repeated EventIndicator filterList = 4; //Filter conditions list
optional EventSort sort = 5; //Sort order
}
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
- Returns
message CorporateAction
{
optional int32 actionType = 1; //Corporate action type
optional string actionTime = 2; //Corporate action time
}
message EventItem
{
optional Qot_Common.Security option = 1; //Option contract security
optional Qot_Common.Security owner = 2; //Underlying security
optional string symbol = 3; //Underlying display symbol
optional string fillTime = 10; //Fill time
optional double fillTimestamp = 11; //Fill timestamp (Unix seconds)
optional int32 tickerType = 12; //Trade direction: 1=BUY, 2=SELL, 3=NEUTRAL
optional double price = 13; //Fill price
optional int64 volume = 14; //Volume (contracts)
optional double turnover = 15; //Turnover
optional int32 optionType = 20; //Option type: 1=CALL, 2=PUT
optional double strikePrice = 21; //Strike price
optional string strikeTime = 22; //Expiration date
optional double strikeTimestamp = 23; //Expiration timestamp (Unix seconds)
optional int32 dte = 24; //Days to expiration
optional double underlyingPrice = 30; //Underlying price
optional double otm = 31; //Out-of-the-money ratio (percentage)
optional double bidPrice = 32; //Best bid price
optional double askPrice = 33; //Best ask price
optional double iv = 34; //Implied volatility (percentage)
optional int64 totalVolume = 35; //Option total daily volume
optional int64 totalOpenInterest = 36; //Option total daily open interest
optional double voRatio = 37; //Volume/OI ratio (percentage)
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; //Market sentiment: 1=BEARISH, 2=BULLISH, 3=NEUTRAL
repeated int32 orderTypeList = 51; //Order type list: 0=NORMAL, 1=SWEEP, 2=CROSS, 4=FLOOR
optional int32 strategyType = 52; //Strategy type: 1=SINGLE_LEG, 2=MULTI_LEG
optional string earningsTime = 60; //Earnings time
optional int32 earningsPubType = 61; //Earnings publish type
repeated CorporateAction corporateActionList = 63; //Corporate action list
repeated Qot_Common.Security industryPlateList = 64; //Industry plate list
repeated Qot_Common.Security conceptPlateList = 65; //Concept plate list
}
message S2C
{
repeated EventItem eventList = 1; //Unusual activity list
optional string nextPage = 2; //Next page marker, empty string means no more pages
optional int32 allCount = 3; //Total count
optional double updateTimestamp = 4; //Data update timestamp
}
message Response
{
required int32 retType = 1 [default = -400]; //RetType, return result
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
- Interface call result, see 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;
Description
Get option unusual activity list
Parameters
message EventIndicator
{
required int32 indicatorType = 1; //EventIndicatorType, filter indicator type
optional Qot_OptionCommon.IndicatorValue indicatorValue = 2; //Filter indicator value
}
message EventSort
{
required int32 indicatorType = 1; //Sort indicator type
required bool isAsc = 2; //Whether ascending order
}
message C2S
{
required int32 optionMarket = 1; //Option market type
optional int32 count = 2; //Page size [1,300]
optional string page = 3; //Pagination marker, empty string for first request
repeated EventIndicator filterList = 4; //Filter conditions list
optional EventSort sort = 5; //Sort order
}
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
- Returns
message CorporateAction
{
optional int32 actionType = 1; //Corporate action type
optional string actionTime = 2; //Corporate action time
}
message EventItem
{
optional Qot_Common.Security option = 1; //Option contract security
optional Qot_Common.Security owner = 2; //Underlying security
optional string symbol = 3; //Underlying display symbol
optional string fillTime = 10; //Fill time
optional double fillTimestamp = 11; //Fill timestamp (Unix seconds)
optional int32 tickerType = 12; //Trade direction: 1=BUY, 2=SELL, 3=NEUTRAL
optional double price = 13; //Fill price
optional int64 volume = 14; //Volume (contracts)
optional double turnover = 15; //Turnover
optional int32 optionType = 20; //Option type: 1=CALL, 2=PUT
optional double strikePrice = 21; //Strike price
optional string strikeTime = 22; //Expiration date
optional double strikeTimestamp = 23; //Expiration timestamp (Unix seconds)
optional int32 dte = 24; //Days to expiration
optional double underlyingPrice = 30; //Underlying price
optional double otm = 31; //Out-of-the-money ratio (percentage)
optional double bidPrice = 32; //Best bid price
optional double askPrice = 33; //Best ask price
optional double iv = 34; //Implied volatility (percentage)
optional int64 totalVolume = 35; //Option total daily volume
optional int64 totalOpenInterest = 36; //Option total daily open interest
optional double voRatio = 37; //Volume/OI ratio (percentage)
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; //Market sentiment: 1=BEARISH, 2=BULLISH, 3=NEUTRAL
repeated int32 orderTypeList = 51; //Order type list: 0=NORMAL, 1=SWEEP, 2=CROSS, 4=FLOOR
optional int32 strategyType = 52; //Strategy type: 1=SINGLE_LEG, 2=MULTI_LEG
optional string earningsTime = 60; //Earnings time
optional int32 earningsPubType = 61; //Earnings publish type
repeated CorporateAction corporateActionList = 63; //Corporate action list
repeated Qot_Common.Security industryPlateList = 64; //Industry plate list
repeated Qot_Common.Security conceptPlateList = 65; //Concept plate list
}
message S2C
{
repeated EventItem eventList = 1; //Unusual activity list
optional string nextPage = 2; //Next page marker, empty string means no more pages
optional int32 allCount = 3; //Total count
optional double updateTimestamp = 4; //Data update timestamp
}
message Response
{
required int32 retType = 1 [default = -400]; //RetType, return result
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
- Interface call result, see RetType
Protocol ID
TODO
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: populate c2s fields per proto
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)
Description
Get option unusual activity list
Parameters
message EventIndicator
{
required int32 indicatorType = 1; //EventIndicatorType, filter indicator type
optional Qot_OptionCommon.IndicatorValue indicatorValue = 2; //Filter indicator value
}
message EventSort
{
required int32 indicatorType = 1; //Sort indicator type
required bool isAsc = 2; //Whether ascending order
}
message C2S
{
required int32 optionMarket = 1; //Option market type
optional int32 count = 2; //Page size [1,300]
optional string page = 3; //Pagination marker, empty string for first request
repeated EventIndicator filterList = 4; //Filter conditions list
optional EventSort sort = 5; //Sort order
}
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
- Returns
message CorporateAction
{
optional int32 actionType = 1; //Corporate action type
optional string actionTime = 2; //Corporate action time
}
message EventItem
{
optional Qot_Common.Security option = 1; //Option contract security
optional Qot_Common.Security owner = 2; //Underlying security
optional string symbol = 3; //Underlying display symbol
optional string fillTime = 10; //Fill time
optional double fillTimestamp = 11; //Fill timestamp (Unix seconds)
optional int32 tickerType = 12; //Trade direction: 1=BUY, 2=SELL, 3=NEUTRAL
optional double price = 13; //Fill price
optional int64 volume = 14; //Volume (contracts)
optional double turnover = 15; //Turnover
optional int32 optionType = 20; //Option type: 1=CALL, 2=PUT
optional double strikePrice = 21; //Strike price
optional string strikeTime = 22; //Expiration date
optional double strikeTimestamp = 23; //Expiration timestamp (Unix seconds)
optional int32 dte = 24; //Days to expiration
optional double underlyingPrice = 30; //Underlying price
optional double otm = 31; //Out-of-the-money ratio (percentage)
optional double bidPrice = 32; //Best bid price
optional double askPrice = 33; //Best ask price
optional double iv = 34; //Implied volatility (percentage)
optional int64 totalVolume = 35; //Option total daily volume
optional int64 totalOpenInterest = 36; //Option total daily open interest
optional double voRatio = 37; //Volume/OI ratio (percentage)
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; //Market sentiment: 1=BEARISH, 2=BULLISH, 3=NEUTRAL
repeated int32 orderTypeList = 51; //Order type list: 0=NORMAL, 1=SWEEP, 2=CROSS, 4=FLOOR
optional int32 strategyType = 52; //Strategy type: 1=SINGLE_LEG, 2=MULTI_LEG
optional string earningsTime = 60; //Earnings time
optional int32 earningsPubType = 61; //Earnings publish type
repeated CorporateAction corporateActionList = 63; //Corporate action list
repeated Qot_Common.Security industryPlateList = 64; //Industry plate list
repeated Qot_Common.Security conceptPlateList = 65; //Concept plate list
}
message S2C
{
repeated EventItem eventList = 1; //Unusual activity list
optional string nextPage = 2; //Next page marker, empty string means no more pages
optional int32 allCount = 3; //Total count
optional double updateTimestamp = 4; //Data update timestamp
}
message Response
{
required int32 retType = 1 [default = -400]; //RetType, return result
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
- Interface call result, see 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
Rate Limit
- Maximum 60 requests per 30 seconds for the option unusual activity interface (for paginated interfaces, only the first call counts)
- Python
- Proto
- C#
- Java
- C++
- JavaScript
get_option_event(option_market, count=None, page=None, filter_list=None, sort=None)
Description
Get option unusual activity list, returns records of large trades, sweeps, and other unusual option activities, with multi-dimensional filtering and sorting by underlying, contract attributes, trade info, Greeks, etc.
Parameters
Parameter Type Description option_market OptionMarket Option market type US_SECURITY=US equity options, US_INDEX=US index options, HK_SECURITY=HK equity options, HK_INDEX=HK index optionscount int Page size Range [1,300]page str Pagination marker Pass empty string for the first request, pass the previously returned next_page for subsequent pagesfilter_list list[EventFilter] Filter conditions list Multiple conditions are combined with AND logic. Supports filtering by underlying (OWNER_LIST), industry sector, option type (CALL/PUT), trade direction, volume, turnover, IV, Delta, etc.sort EventSort Sort order Default sorted by time in descending orderReturns
Parameter Type Description ret RET_CODE Interface call result data dict When ret == RET_OK, returns unusual activity data str When ret != RET_OK, returns error description data dictionary contains:
Field Type Description event_list pandas.DataFrame Unusual activity list next_page str Next page marker Empty string means no more pagesall_count int Total count update_timestamp float Data update timestamp event_list DataFrame fields:
Field Type Description option_code str Option contract code owner_code str Underlying stock code symbol str Underlying display code (e.g., TSLA) fill_time str Fill time fill_timestamp float Fill timestamp (Unix seconds) ticker_type str Trade direction BUY/SELL/NEUTRALprice float Fill price volume int Volume (contracts) turnover float Turnover option_type str Option type CALL/PUTstrike_price float Strike price strike_time str Expiration date strike_timestamp float Expiration timestamp (Unix seconds) dte int Days to expiration underlying_price float Underlying price otm float Out-of-the-money ratio (percentage) bid_price float Best bid price ask_price float Best ask price iv float Implied volatility (percentage) total_volume int Option total daily volume total_open_interest int Option total daily open interest vo_ratio float Volume/OI ratio (percentage) delta float Delta gamma float Gamma vega float Vega theta float Theta rho float Rho sentiment str Market sentiment BEARISH/BULLISH/NEUTRALorder_type_list list Order type list NORMAL/SWEEP/CROSS/FLOORstrategy_type str Strategy type SINGLE_LEG/MULTI_LEGearnings_time str Earnings time earnings_pub_type int Earnings publish type corporate_action_list list Corporate action list industry_plate_list list Industry plate list concept_plate_list list Concept plate 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
Description
Get option unusual activity list
Parameters
message EventIndicator
{
required int32 indicatorType = 1; //EventIndicatorType, filter indicator type
optional Qot_OptionCommon.IndicatorValue indicatorValue = 2; //Filter indicator value
}
message EventSort
{
required int32 indicatorType = 1; //Sort indicator type
required bool isAsc = 2; //Whether ascending order
}
message C2S
{
required int32 optionMarket = 1; //Option market type
optional int32 count = 2; //Page size [1,300]
optional string page = 3; //Pagination marker, empty string for first request
repeated EventIndicator filterList = 4; //Filter conditions list
optional EventSort sort = 5; //Sort order
}
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
- Returns
message CorporateAction
{
optional int32 actionType = 1; //Corporate action type
optional string actionTime = 2; //Corporate action time
}
message EventItem
{
optional Qot_Common.Security option = 1; //Option contract security
optional Qot_Common.Security owner = 2; //Underlying security
optional string symbol = 3; //Underlying display symbol
optional string fillTime = 10; //Fill time
optional double fillTimestamp = 11; //Fill timestamp (Unix seconds)
optional int32 tickerType = 12; //Trade direction: 1=BUY, 2=SELL, 3=NEUTRAL
optional double price = 13; //Fill price
optional int64 volume = 14; //Volume (contracts)
optional double turnover = 15; //Turnover
optional int32 optionType = 20; //Option type: 1=CALL, 2=PUT
optional double strikePrice = 21; //Strike price
optional string strikeTime = 22; //Expiration date
optional double strikeTimestamp = 23; //Expiration timestamp (Unix seconds)
optional int32 dte = 24; //Days to expiration
optional double underlyingPrice = 30; //Underlying price
optional double otm = 31; //Out-of-the-money ratio (percentage)
optional double bidPrice = 32; //Best bid price
optional double askPrice = 33; //Best ask price
optional double iv = 34; //Implied volatility (percentage)
optional int64 totalVolume = 35; //Option total daily volume
optional int64 totalOpenInterest = 36; //Option total daily open interest
optional double voRatio = 37; //Volume/OI ratio (percentage)
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; //Market sentiment: 1=BEARISH, 2=BULLISH, 3=NEUTRAL
repeated int32 orderTypeList = 51; //Order type list: 0=NORMAL, 1=SWEEP, 2=CROSS, 4=FLOOR
optional int32 strategyType = 52; //Strategy type: 1=SINGLE_LEG, 2=MULTI_LEG
optional string earningsTime = 60; //Earnings time
optional int32 earningsPubType = 61; //Earnings publish type
repeated CorporateAction corporateActionList = 63; //Corporate action list
repeated Qot_Common.Security industryPlateList = 64; //Industry plate list
repeated Qot_Common.Security conceptPlateList = 65; //Concept plate list
}
message S2C
{
repeated EventItem eventList = 1; //Unusual activity list
optional string nextPage = 2; //Next page marker, empty string means no more pages
optional int32 allCount = 3; //Total count
optional double updateTimestamp = 4; //Data update timestamp
}
message Response
{
required int32 retType = 1 [default = -400]; //RetType, return result
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
- Interface call result, see RetType
Protocol ID
3307
uint GetOptionEvent(Qot_GetOptionEvent.Request req); virtual void OnReply_GetOptionEvent(MMAPI_Conn client, uint nSerialNo, Qot_GetOptionEvent.Response rsp);
Description
Get option unusual activity list
Parameters
message EventIndicator
{
required int32 indicatorType = 1; //EventIndicatorType, filter indicator type
optional Qot_OptionCommon.IndicatorValue indicatorValue = 2; //Filter indicator value
}
message EventSort
{
required int32 indicatorType = 1; //Sort indicator type
required bool isAsc = 2; //Whether ascending order
}
message C2S
{
required int32 optionMarket = 1; //Option market type
optional int32 count = 2; //Page size [1,300]
optional string page = 3; //Pagination marker, empty string for first request
repeated EventIndicator filterList = 4; //Filter conditions list
optional EventSort sort = 5; //Sort order
}
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
- Returns
message CorporateAction
{
optional int32 actionType = 1; //Corporate action type
optional string actionTime = 2; //Corporate action time
}
message EventItem
{
optional Qot_Common.Security option = 1; //Option contract security
optional Qot_Common.Security owner = 2; //Underlying security
optional string symbol = 3; //Underlying display symbol
optional string fillTime = 10; //Fill time
optional double fillTimestamp = 11; //Fill timestamp (Unix seconds)
optional int32 tickerType = 12; //Trade direction: 1=BUY, 2=SELL, 3=NEUTRAL
optional double price = 13; //Fill price
optional int64 volume = 14; //Volume (contracts)
optional double turnover = 15; //Turnover
optional int32 optionType = 20; //Option type: 1=CALL, 2=PUT
optional double strikePrice = 21; //Strike price
optional string strikeTime = 22; //Expiration date
optional double strikeTimestamp = 23; //Expiration timestamp (Unix seconds)
optional int32 dte = 24; //Days to expiration
optional double underlyingPrice = 30; //Underlying price
optional double otm = 31; //Out-of-the-money ratio (percentage)
optional double bidPrice = 32; //Best bid price
optional double askPrice = 33; //Best ask price
optional double iv = 34; //Implied volatility (percentage)
optional int64 totalVolume = 35; //Option total daily volume
optional int64 totalOpenInterest = 36; //Option total daily open interest
optional double voRatio = 37; //Volume/OI ratio (percentage)
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; //Market sentiment: 1=BEARISH, 2=BULLISH, 3=NEUTRAL
repeated int32 orderTypeList = 51; //Order type list: 0=NORMAL, 1=SWEEP, 2=CROSS, 4=FLOOR
optional int32 strategyType = 52; //Strategy type: 1=SINGLE_LEG, 2=MULTI_LEG
optional string earningsTime = 60; //Earnings time
optional int32 earningsPubType = 61; //Earnings publish type
repeated CorporateAction corporateActionList = 63; //Corporate action list
repeated Qot_Common.Security industryPlateList = 64; //Industry plate list
repeated Qot_Common.Security conceptPlateList = 65; //Concept plate list
}
message S2C
{
repeated EventItem eventList = 1; //Unusual activity list
optional string nextPage = 2; //Next page marker, empty string means no more pages
optional int32 allCount = 3; //Total count
optional double updateTimestamp = 4; //Data update timestamp
}
message Response
{
required int32 retType = 1 [default = -400]; //RetType, return result
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
- Interface call result, see RetType
协议 ID
3307
int getOptionEvent(Qot_GetOptionEvent.Request req) onReply_GetOptionEvent(MMAPI_Conn client, int nSerialNo, Qot_GetOptionEvent.Response rsp)
Description
Get option unusual activity list
Parameters
message EventIndicator
{
required int32 indicatorType = 1; //EventIndicatorType, filter indicator type
optional Qot_OptionCommon.IndicatorValue indicatorValue = 2; //Filter indicator value
}
message EventSort
{
required int32 indicatorType = 1; //Sort indicator type
required bool isAsc = 2; //Whether ascending order
}
message C2S
{
required int32 optionMarket = 1; //Option market type
optional int32 count = 2; //Page size [1,300]
optional string page = 3; //Pagination marker, empty string for first request
repeated EventIndicator filterList = 4; //Filter conditions list
optional EventSort sort = 5; //Sort order
}
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
- Returns
message CorporateAction
{
optional int32 actionType = 1; //Corporate action type
optional string actionTime = 2; //Corporate action time
}
message EventItem
{
optional Qot_Common.Security option = 1; //Option contract security
optional Qot_Common.Security owner = 2; //Underlying security
optional string symbol = 3; //Underlying display symbol
optional string fillTime = 10; //Fill time
optional double fillTimestamp = 11; //Fill timestamp (Unix seconds)
optional int32 tickerType = 12; //Trade direction: 1=BUY, 2=SELL, 3=NEUTRAL
optional double price = 13; //Fill price
optional int64 volume = 14; //Volume (contracts)
optional double turnover = 15; //Turnover
optional int32 optionType = 20; //Option type: 1=CALL, 2=PUT
optional double strikePrice = 21; //Strike price
optional string strikeTime = 22; //Expiration date
optional double strikeTimestamp = 23; //Expiration timestamp (Unix seconds)
optional int32 dte = 24; //Days to expiration
optional double underlyingPrice = 30; //Underlying price
optional double otm = 31; //Out-of-the-money ratio (percentage)
optional double bidPrice = 32; //Best bid price
optional double askPrice = 33; //Best ask price
optional double iv = 34; //Implied volatility (percentage)
optional int64 totalVolume = 35; //Option total daily volume
optional int64 totalOpenInterest = 36; //Option total daily open interest
optional double voRatio = 37; //Volume/OI ratio (percentage)
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; //Market sentiment: 1=BEARISH, 2=BULLISH, 3=NEUTRAL
repeated int32 orderTypeList = 51; //Order type list: 0=NORMAL, 1=SWEEP, 2=CROSS, 4=FLOOR
optional int32 strategyType = 52; //Strategy type: 1=SINGLE_LEG, 2=MULTI_LEG
optional string earningsTime = 60; //Earnings time
optional int32 earningsPubType = 61; //Earnings publish type
repeated CorporateAction corporateActionList = 63; //Corporate action list
repeated Qot_Common.Security industryPlateList = 64; //Industry plate list
repeated Qot_Common.Security conceptPlateList = 65; //Concept plate list
}
message S2C
{
repeated EventItem eventList = 1; //Unusual activity list
optional string nextPage = 2; //Next page marker, empty string means no more pages
optional int32 allCount = 3; //Total count
optional double updateTimestamp = 4; //Data update timestamp
}
message Response
{
required int32 retType = 1 [default = -400]; //RetType, return result
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
- Interface call result, see 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;
Description
Get option unusual activity list
Parameters
message EventIndicator
{
required int32 indicatorType = 1; //EventIndicatorType, filter indicator type
optional Qot_OptionCommon.IndicatorValue indicatorValue = 2; //Filter indicator value
}
message EventSort
{
required int32 indicatorType = 1; //Sort indicator type
required bool isAsc = 2; //Whether ascending order
}
message C2S
{
required int32 optionMarket = 1; //Option market type
optional int32 count = 2; //Page size [1,300]
optional string page = 3; //Pagination marker, empty string for first request
repeated EventIndicator filterList = 4; //Filter conditions list
optional EventSort sort = 5; //Sort order
}
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
- Returns
message CorporateAction
{
optional int32 actionType = 1; //Corporate action type
optional string actionTime = 2; //Corporate action time
}
message EventItem
{
optional Qot_Common.Security option = 1; //Option contract security
optional Qot_Common.Security owner = 2; //Underlying security
optional string symbol = 3; //Underlying display symbol
optional string fillTime = 10; //Fill time
optional double fillTimestamp = 11; //Fill timestamp (Unix seconds)
optional int32 tickerType = 12; //Trade direction: 1=BUY, 2=SELL, 3=NEUTRAL
optional double price = 13; //Fill price
optional int64 volume = 14; //Volume (contracts)
optional double turnover = 15; //Turnover
optional int32 optionType = 20; //Option type: 1=CALL, 2=PUT
optional double strikePrice = 21; //Strike price
optional string strikeTime = 22; //Expiration date
optional double strikeTimestamp = 23; //Expiration timestamp (Unix seconds)
optional int32 dte = 24; //Days to expiration
optional double underlyingPrice = 30; //Underlying price
optional double otm = 31; //Out-of-the-money ratio (percentage)
optional double bidPrice = 32; //Best bid price
optional double askPrice = 33; //Best ask price
optional double iv = 34; //Implied volatility (percentage)
optional int64 totalVolume = 35; //Option total daily volume
optional int64 totalOpenInterest = 36; //Option total daily open interest
optional double voRatio = 37; //Volume/OI ratio (percentage)
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; //Market sentiment: 1=BEARISH, 2=BULLISH, 3=NEUTRAL
repeated int32 orderTypeList = 51; //Order type list: 0=NORMAL, 1=SWEEP, 2=CROSS, 4=FLOOR
optional int32 strategyType = 52; //Strategy type: 1=SINGLE_LEG, 2=MULTI_LEG
optional string earningsTime = 60; //Earnings time
optional int32 earningsPubType = 61; //Earnings publish type
repeated CorporateAction corporateActionList = 63; //Corporate action list
repeated Qot_Common.Security industryPlateList = 64; //Industry plate list
repeated Qot_Common.Security conceptPlateList = 65; //Concept plate list
}
message S2C
{
repeated EventItem eventList = 1; //Unusual activity list
optional string nextPage = 2; //Next page marker, empty string means no more pages
optional int32 allCount = 3; //Total count
optional double updateTimestamp = 4; //Data update timestamp
}
message Response
{
required int32 retType = 1 [default = -400]; //RetType, return result
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
- Interface call result, see RetType
Protocol ID
TODO
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: populate c2s fields per proto
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)
Description
Get option unusual activity list
Parameters
message EventIndicator
{
required int32 indicatorType = 1; //EventIndicatorType, filter indicator type
optional Qot_OptionCommon.IndicatorValue indicatorValue = 2; //Filter indicator value
}
message EventSort
{
required int32 indicatorType = 1; //Sort indicator type
required bool isAsc = 2; //Whether ascending order
}
message C2S
{
required int32 optionMarket = 1; //Option market type
optional int32 count = 2; //Page size [1,300]
optional string page = 3; //Pagination marker, empty string for first request
repeated EventIndicator filterList = 4; //Filter conditions list
optional EventSort sort = 5; //Sort order
}
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
- Returns
message CorporateAction
{
optional int32 actionType = 1; //Corporate action type
optional string actionTime = 2; //Corporate action time
}
message EventItem
{
optional Qot_Common.Security option = 1; //Option contract security
optional Qot_Common.Security owner = 2; //Underlying security
optional string symbol = 3; //Underlying display symbol
optional string fillTime = 10; //Fill time
optional double fillTimestamp = 11; //Fill timestamp (Unix seconds)
optional int32 tickerType = 12; //Trade direction: 1=BUY, 2=SELL, 3=NEUTRAL
optional double price = 13; //Fill price
optional int64 volume = 14; //Volume (contracts)
optional double turnover = 15; //Turnover
optional int32 optionType = 20; //Option type: 1=CALL, 2=PUT
optional double strikePrice = 21; //Strike price
optional string strikeTime = 22; //Expiration date
optional double strikeTimestamp = 23; //Expiration timestamp (Unix seconds)
optional int32 dte = 24; //Days to expiration
optional double underlyingPrice = 30; //Underlying price
optional double otm = 31; //Out-of-the-money ratio (percentage)
optional double bidPrice = 32; //Best bid price
optional double askPrice = 33; //Best ask price
optional double iv = 34; //Implied volatility (percentage)
optional int64 totalVolume = 35; //Option total daily volume
optional int64 totalOpenInterest = 36; //Option total daily open interest
optional double voRatio = 37; //Volume/OI ratio (percentage)
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; //Market sentiment: 1=BEARISH, 2=BULLISH, 3=NEUTRAL
repeated int32 orderTypeList = 51; //Order type list: 0=NORMAL, 1=SWEEP, 2=CROSS, 4=FLOOR
optional int32 strategyType = 52; //Strategy type: 1=SINGLE_LEG, 2=MULTI_LEG
optional string earningsTime = 60; //Earnings time
optional int32 earningsPubType = 61; //Earnings publish type
repeated CorporateAction corporateActionList = 63; //Corporate action list
repeated Qot_Common.Security industryPlateList = 64; //Industry plate list
repeated Qot_Common.Security conceptPlateList = 65; //Concept plate list
}
message S2C
{
repeated EventItem eventList = 1; //Unusual activity list
optional string nextPage = 2; //Next page marker, empty string means no more pages
optional int32 allCount = 3; //Total count
optional double updateTimestamp = 4; //Data update timestamp
}
message Response
{
required int32 retType = 1 [default = -400]; //RetType, return result
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
- Interface call result, see 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
Rate Limit
- Maximum 60 requests per 30 seconds for the option unusual activity interface (for paginated interfaces, only the first call counts)