# 期權賣方專區
- Python
- Proto
- C#
- Java
- C++
- JavaScript
get_option_seller_screener(market, seller_type, sort_type=None, is_asc=None, filter_list=None)
介紹
獲取期權賣方專區篩選列表,返回適合賣方策略(Cash Secured Put / Covered Call)的期權合約,包含收益率、行權概率等數據。
參數
參數 類型 說明 market OptionMarket 期權市場類型 US_SECURITY=美股股票期權、HK_SECURITY=港股股票期權seller_type SellerType 賣方策略類型 COVERED_CALL=備兌看漲、CASH_SECURED_PUT=現金擔保賣出看跌(港股僅支持 CASH_SECURED_PUT)sort_type SellerSortType 排序類型 ANNUALIZED_RETURN=年化收益率、INTERVAL_RETURN=區間收益率、ITM_PROBABILITY=行權概率、PREMIUM=權利金is_asc bool 是否升序 默認 False(降序)filter_list list[SellerFilter] 篩選條件列表 多條件為 AND 關係篩選器(SellerFilter)
透過 SellerFilter 構造篩選條件,多個條件為 AND 關係。
SellerFilter(indicator_type, value_list=None, interval_min=None, interval_max=None, min_inclusive=True, max_inclusive=True, security_list=None)1
2參數 類型 說明 indicator_type SellerIndicatorType 篩選因子類型 value_list list 確切值列表(枚舉值或整數) interval_min float 區間下限 interval_max float 區間上限 min_inclusive bool 下限是否閉區間,默認 True max_inclusive bool 上限是否閉區間,默認 True security_list list[str] 證券代碼列表 篩選因子(完整枚舉見 SellerIndicatorType),按篩選方式分組:
篩選方式 用哪個參數 適用因子 語義 security_list security_listOWNER_LIST只看指定標的 value_list value_listSTOCK_CATEGORY、PLATE、EXPIRATION_TYPE、OPTION_EXPIRATION_TYPE、STRIKE_DATE_TIMESTAMP命中枚舉值集合 範圍 interval_min/interval_maxIV、IV_RANK、IV_PERCENTILE、VOLUME、LEFT_DAYS、ANNUALIZED_RETURN、OTM_DEGREE等落在區間內 涉及百分比的因子(如 IV_RANK、IV_PERCENTILE)直接輸入小數,0.2 代表 20%。一個條件只承載一種篩選方式,三種互斥,按因子所屬方式對號入座。`STOCK_CATEGORY` 在 SDK 內置枚舉映射,可直接傳 `value_list=[StockCategory.ETF]`;`EXPIRATION_TYPE` 等可傳枚舉或對應整數。
返回
參數 類型 說明 ret RET_CODE 接口調用結果 data pandas.DataFrame 當 ret == RET_OK,返回篩選結果 str 當 ret != RET_OK,返回錯誤描述 返回 DataFrame 字段:
字段 類型 說明 option str 期權合約代碼 name str 期權名稱 option_type str 期權方向 CALL、PUTstrike_price float 行權價 strike_time str 到期日時間字符串 strike_timestamp float 到期日時間戳(Unix 秒) left_days int 距到期天數 option_price float 期權價格 stock_price float 標的股票價格 premium float 權利金 otm_degree float 價外程度(%) iv float 隱含波動率(%) interval_return float 區間收益率(%) annualized_return float 年化收益率(%) itm_probability float 行權概率(%) striked_interval_return float 行權時區間收益率(%) 僅 Covered Callstriked_annualized_return float 行權時年化收益率(%) 僅 Covered Callowner str 標的股票代碼
Example
from futu import *
quote_ctx = OpenQuoteContext(host='127.0.0.1', port=11111)
# 篩選器用法引導(按需取消註釋,構造後傳入 filter_list,多條件為 AND 關係):
# # ① 標的列表篩選 — 只看自選標的
# f_owner = SellerFilter(SellerIndicatorType.OWNER_LIST,
# security_list=['US.TSLA', 'US.AAPL', 'US.NVDA'])
# # ② 確切值篩選 — ETF 標的 + 月期權
# f_category = SellerFilter(SellerIndicatorType.STOCK_CATEGORY,
# value_list=[StockCategory.ETF])
# f_expiry = SellerFilter(SellerIndicatorType.EXPIRATION_TYPE,
# value_list=[ExpirationType.MONTHLY])
# # ③ 範圍篩選 — 距到期 7~30 天、價外程度 0%~15%
# f_days = SellerFilter(SellerIndicatorType.LEFT_DAYS, interval_min=7, interval_max=30)
# f_otm = SellerFilter(SellerIndicatorType.OTM_DEGREE, interval_min=0.0, interval_max=15.0)
ret, data = quote_ctx.get_option_seller_screener(
market=OptionMarket.US_SECURITY,
seller_type=SellerType.COVERED_CALL,
sort_type=SellerSortType.ANNUALIZED_RETURN,
is_asc=False
# filter_list=[f_days, f_otm] # 多條件 AND,傳入上方構造的篩選條件
)
if ret == RET_OK:
print(data)
else:
print('error:', data)
quote_ctx.close()
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
- Output
option name option_type strike_price strike_time strike_timestamp left_days option_price stock_price premium otm_degree iv interval_return annualized_return itm_probability striked_interval_return striked_annualized_return owner
0 US.SOXL260618C235000 SOXL 260618 235.00C CALL 235.0 2026-06-18 1.781755e+09 3 21.850 234.68 2185.0 0.136 234.988 10.266 1074.855 45.724 10.416 1090.597 US.SOXL
1 US.SOXL260618C237500 SOXL 260618 237.50C CALL 237.5 2026-06-18 1.781755e+09 3 20.675 234.68 2067.5 1.201 234.423 9.660 1011.470 43.682 10.978 1149.431 US.SOXL
2 US.SOXL260618C240000 SOXL 260618 240.00C CALL 240.0 2026-06-18 1.781755e+09 3 19.250 234.68 1925.0 2.266 230.652 8.935 935.526 41.678 11.405 1194.071 US.SOXL
3 US.WDS260618C25000 WDS 260618 25.00C CALL 25.0 2026-06-18 1.781755e+09 3 1.875 23.07 187.5 8.365 292.148 8.846 928.963 11.794 17.952 1885.177 US.WDS
4 US.SOXL260618C242500 SOXL 260618 242.50C CALL 242.5 2026-06-18 1.781755e+09 3 18.350 234.68 1835.0 3.332 232.108 8.482 888.077 39.715 12.097 1266.538 US.SOXL
...
2
3
4
5
6
7
# Qot_GetOptionSellerScreener.proto
介紹
獲取期權賣方專區篩選列表
參數
message C2S {
required int32 optionMarket = 1; // Qot_OptionCommon.OptionMarket
required int32 sellerType = 2; // Qot_OptionCommon.SellerType
optional int32 sortType = 3; // Qot_OptionCommon.SellerSortType
optional bool isAsc = 4; // 默認 false
repeated Qot_OptionCommon.SellerIndicator filterList = 5;
}
message Request {
required C2S c2s = 1;
}
2
3
4
5
6
7
8
9
10
11
- 返回
message SellerItem {
required Qot_Common.Security option = 1;
optional string name = 2;
optional int32 optionType = 3; // Qot_Common.OptionType
optional double strikePrice = 4;
optional string strikeTime = 5;
optional double strikeTimestamp = 6;
optional int32 leftDays = 7;
optional double optionPrice = 8;
optional double stockPrice = 9;
optional double premium = 10;
optional double otmDegree = 11; // (%)
optional double iv = 12; // (%)
optional double intervalReturn = 13; // (%)
optional double annualizedReturn = 14; // (%)
optional double itmProbability = 15; // (%)
optional double strikedIntervalReturn = 16; // (%)
optional double strikedAnnualizedReturn = 17; // (%)
optional Qot_Common.Security owner = 18;
}
message S2C {
repeated SellerItem itemList = 1;
}
message Response {
required int32 retType = 1 [default = -400];
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
- 接口調用結果,結構參見 RetType
協議 ID
3314
uint GetOptionSellerScreener(Qot_GetOptionSellerScreener.Request req); virtual void OnReply_GetOptionSellerScreener(FTAPI_Conn client, uint nSerialNo, Qot_GetOptionSellerScreener.Response rsp);
介紹
獲取期權賣方專區篩選列表
參數
message C2S {
required int32 optionMarket = 1; // Qot_OptionCommon.OptionMarket
required int32 sellerType = 2; // Qot_OptionCommon.SellerType
optional int32 sortType = 3; // Qot_OptionCommon.SellerSortType
optional bool isAsc = 4; // 默認 false
repeated Qot_OptionCommon.SellerIndicator filterList = 5;
}
message Request {
required C2S c2s = 1;
}
2
3
4
5
6
7
8
9
10
11
- 返回
message SellerItem {
required Qot_Common.Security option = 1;
optional string name = 2;
optional int32 optionType = 3; // Qot_Common.OptionType
optional double strikePrice = 4;
optional string strikeTime = 5;
optional double strikeTimestamp = 6;
optional int32 leftDays = 7;
optional double optionPrice = 8;
optional double stockPrice = 9;
optional double premium = 10;
optional double otmDegree = 11; // (%)
optional double iv = 12; // (%)
optional double intervalReturn = 13; // (%)
optional double annualizedReturn = 14; // (%)
optional double itmProbability = 15; // (%)
optional double strikedIntervalReturn = 16; // (%)
optional double strikedAnnualizedReturn = 17; // (%)
optional Qot_Common.Security owner = 18;
}
message S2C {
repeated SellerItem itemList = 1;
}
message Response {
required int32 retType = 1 [default = -400];
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
- 接口調用結果,結構參見 RetType
協議 ID
3314
Example
public class Program : FTSPI_Qot, FTSPI_Conn
{
FTAPI_Qot qot = new FTAPI_Qot();
public Program()
{
qot.SetClientInfo("csharp", 1);
qot.SetConnCallback(this);
qot.SetQotCallback(this);
}
public void Start()
{
qot.InitConnect("127.0.0.1", (ushort)11111, false);
}
public void OnInitConnect(FTAPI_Conn client, long errCode, String desc)
{
if (errCode != 0) return;
var c2s = Qot_GetOptionSellerScreener.C2S.CreateBuilder()
// TODO: 按 proto 填充 c2s 字段
.Build();
var req = Qot_GetOptionSellerScreener.Request.CreateBuilder().SetC2S(c2s).Build();
uint seqNo = qot.GetOptionSellerScreener(req);
Console.Write("Send GetOptionSellerScreener: {0}\n", seqNo);
}
public void OnReply_GetOptionSellerScreener(FTAPI_Conn client, uint nSerialNo, Qot_GetOptionSellerScreener.Response rsp)
{
Console.Write("Reply: {0} {1}\n", nSerialNo, rsp.ToString());
}
public static void Main(String[] args)
{
FTAPI.Init();
new Program().Start();
while (true) Thread.Sleep(1000 * 600);
}
}
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
- Output
Send GetOptionSellerScreener: 1
Reply: 1 { "market": 1, "code": "SOXL" }
}
]
}
2
3
4
5
int getOptionSellerScreener(Qot_GetOptionSellerScreener.Request req) onReply_GetOptionSellerScreener(FTAPI_Conn client, int nSerialNo, Qot_GetOptionSellerScreener.Response rsp)
介紹
獲取期權賣方專區篩選列表
參數
message C2S {
required int32 optionMarket = 1; // Qot_OptionCommon.OptionMarket
required int32 sellerType = 2; // Qot_OptionCommon.SellerType
optional int32 sortType = 3; // Qot_OptionCommon.SellerSortType
optional bool isAsc = 4; // 默認 false
repeated Qot_OptionCommon.SellerIndicator filterList = 5;
}
message Request {
required C2S c2s = 1;
}
2
3
4
5
6
7
8
9
10
11
- 返回
message SellerItem {
required Qot_Common.Security option = 1;
optional string name = 2;
optional int32 optionType = 3; // Qot_Common.OptionType
optional double strikePrice = 4;
optional string strikeTime = 5;
optional double strikeTimestamp = 6;
optional int32 leftDays = 7;
optional double optionPrice = 8;
optional double stockPrice = 9;
optional double premium = 10;
optional double otmDegree = 11; // (%)
optional double iv = 12; // (%)
optional double intervalReturn = 13; // (%)
optional double annualizedReturn = 14; // (%)
optional double itmProbability = 15; // (%)
optional double strikedIntervalReturn = 16; // (%)
optional double strikedAnnualizedReturn = 17; // (%)
optional Qot_Common.Security owner = 18;
}
message S2C {
repeated SellerItem itemList = 1;
}
message Response {
required int32 retType = 1 [default = -400];
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
- 接口調用結果,結構參見 RetType
協議 ID
3314
Example
public class Program implements FTSPI_Qot, FTSPI_Conn {
private FTAPI_Conn_Qot qot = new FTAPI_Conn_Qot();
public Program() {
qot.setClientInfo("java", 1);
qot.setConnCallback(this);
qot.setQotCallback(this);
}
public void start() {
qot.initConnect("127.0.0.1", (short) 11111, false);
}
@Override
public void onInitConnect(FTAPI_Conn client, long errCode, String desc) {
if (errCode != 0) return;
Qot_GetOptionSellerScreener.C2S c2s = Qot_GetOptionSellerScreener.C2S.newBuilder()
// TODO: 按 proto 填充 c2s 字段
.build();
Qot_GetOptionSellerScreener.Request req = Qot_GetOptionSellerScreener.Request.newBuilder()
.setC2S(c2s).build();
int seqNo = qot.getOptionSellerScreener(req);
System.out.println("Send getOptionSellerScreener: " + seqNo);
}
@Override
public void onReply_GetOptionSellerScreener(FTAPI_Conn client, int nSerialNo, Qot_GetOptionSellerScreener.Response rsp) {
System.out.println("Reply: " + nSerialNo + " " + rsp.toString());
}
public static void main(String[] args) {
FTAPI.init();
new Program().start();
while (true) {
try { Thread.sleep(1000 * 600); } catch (InterruptedException e) {}
}
}
}
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
- Output
Send getOptionSellerScreener: 1
Reply: 1 { "market": 1, "code": "SOXL" }
}
]
}
2
3
4
5
Futu::u32_t GetOptionSellerScreener(const Qot_GetOptionSellerScreener::Request &stReq);
virtual void OnReply_GetOptionSellerScreener(Futu::u32_t nSerialNo, const Qot_GetOptionSellerScreener::Response &stRsp) = 0;
介紹
獲取期權賣方專區篩選列表
參數
message C2S {
required int32 optionMarket = 1; // Qot_OptionCommon.OptionMarket
required int32 sellerType = 2; // Qot_OptionCommon.SellerType
optional int32 sortType = 3; // Qot_OptionCommon.SellerSortType
optional bool isAsc = 4; // 默認 false
repeated Qot_OptionCommon.SellerIndicator filterList = 5;
}
message Request {
required C2S c2s = 1;
}
2
3
4
5
6
7
8
9
10
11
- 返回
message SellerItem {
required Qot_Common.Security option = 1;
optional string name = 2;
optional int32 optionType = 3; // Qot_Common.OptionType
optional double strikePrice = 4;
optional string strikeTime = 5;
optional double strikeTimestamp = 6;
optional int32 leftDays = 7;
optional double optionPrice = 8;
optional double stockPrice = 9;
optional double premium = 10;
optional double otmDegree = 11; // (%)
optional double iv = 12; // (%)
optional double intervalReturn = 13; // (%)
optional double annualizedReturn = 14; // (%)
optional double itmProbability = 15; // (%)
optional double strikedIntervalReturn = 16; // (%)
optional double strikedAnnualizedReturn = 17; // (%)
optional Qot_Common.Security owner = 18;
}
message S2C {
repeated SellerItem itemList = 1;
}
message Response {
required int32 retType = 1 [default = -400];
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
- 接口調用結果,結構參見 RetType
協議 ID
3314
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_GetOptionSellerScreener::Request req;
Qot_GetOptionSellerScreener::C2S *c2s = req.mutable_c2s();
// TODO: 按 proto 填充 c2s 字段
m_GetOptionSellerScreenerSerialNo = m_pQotApi->GetOptionSellerScreener(req);
}
virtual void OnReply_GetOptionSellerScreener(Futu::u32_t nSerialNo, const Qot_GetOptionSellerScreener::Response &stRsp) {
if (nSerialNo != m_GetOptionSellerScreenerSerialNo) return;
string resp_str;
ProtoBufToBodyData(stRsp, resp_str);
cout << UTF8ToLocal(resp_str) << endl;
}
protected:
FTAPI_Qot *m_pQotApi;
Futu::u32_t m_GetOptionSellerScreenerSerialNo = 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
getOptionSellerScreener(qotGetOptionSellerScreener)
介紹
獲取期權賣方專區篩選列表
參數
message C2S {
required int32 optionMarket = 1; // Qot_OptionCommon.OptionMarket
required int32 sellerType = 2; // Qot_OptionCommon.SellerType
optional int32 sortType = 3; // Qot_OptionCommon.SellerSortType
optional bool isAsc = 4; // 默認 false
repeated Qot_OptionCommon.SellerIndicator filterList = 5;
}
message Request {
required C2S c2s = 1;
}
2
3
4
5
6
7
8
9
10
11
- 返回
message SellerItem {
required Qot_Common.Security option = 1;
optional string name = 2;
optional int32 optionType = 3; // Qot_Common.OptionType
optional double strikePrice = 4;
optional string strikeTime = 5;
optional double strikeTimestamp = 6;
optional int32 leftDays = 7;
optional double optionPrice = 8;
optional double stockPrice = 9;
optional double premium = 10;
optional double otmDegree = 11; // (%)
optional double iv = 12; // (%)
optional double intervalReturn = 13; // (%)
optional double annualizedReturn = 14; // (%)
optional double itmProbability = 15; // (%)
optional double strikedIntervalReturn = 16; // (%)
optional double strikedAnnualizedReturn = 17; // (%)
optional Qot_Common.Security owner = 18;
}
message S2C {
repeated SellerItem itemList = 1;
}
message Response {
required int32 retType = 1 [default = -400];
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
- 接口調用結果,結構參見 RetType
協議 ID
3314
Example
import ftWebsocket from "futu-api";
import { Common, Qot_OptionCommon } from "futu-api/proto";
import beautify from "js-beautify";
function QotGetOptionSellerScreener(){
const { RetType } = Common
const { OptionMarket, SellerType, SellerSortType } = 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,
sellerType: SellerType.SellerType_CoveredCall,
sortType: SellerSortType.SellerSortType_AnnualizedReturn,
},
};
websocket.GetOptionSellerScreener(req)
.then((res)=>{
let { errCode, retMsg, retType, s2c } = res
console.log("GetOptionSellerScreener: 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);
}
QotGetOptionSellerScreener()
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
- Output
GetOptionSellerScreener: errCode 0, retMsg , retType 0
{
"itemList": [
{
"option": { "market": 1, "code": "SOXL260618C235000" },
"name": "SOXL 260618 235.00C",
"optionType": 1,
"strikePrice": 235,
"strikeTime": "2026-06-18",
"strikeTimestamp": 1781755000,
"leftDays": 3,
"optionPrice": 21.85,
"stockPrice": 234.68,
"premium": 2185,
"otmDegree": 0.136,
"iv": 234.988,
"intervalReturn": 10.266,
"annualizedReturn": 1074.855,
"itmProbability": 45.724,
"strikedIntervalReturn": 10.416,
"strikedAnnualizedReturn": 1090.597,
"owner": { "market": 1, "code": "SOXL" }
},
{
"option": { "market": 1, "code": "SOXL260618C237500" },
"name": "SOXL 260618 237.50C",
"optionType": 1,
"strikePrice": 237.5,
"strikeTime": "2026-06-18",
"strikeTimestamp": 1781755000,
"leftDays": 3,
"optionPrice": 20.675,
"stockPrice": 234.68,
"premium": 2067.5,
"otmDegree": 1.201,
"iv": 234.423,
"intervalReturn": 9.66,
"annualizedReturn": 1011.47,
"itmProbability": 43.682,
"strikedIntervalReturn": 10.978,
"strikedAnnualizedReturn": 1149.431,
"owner": { "market": 1, "code": "SOXL" }
}
]
}
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
接口限制
- 30 秒內最多請求 60 次期權賣方專區接口
- Python
- Proto
- C#
- Java
- C++
- JavaScript
get_option_seller_screener(market, seller_type, sort_type=None, is_asc=None, filter_list=None)
介紹
獲取期權賣方專區篩選列表,返回適合賣方策略(Cash Secured Put / Covered Call)的期權合約,包含收益率、行權概率等數據。
參數
參數 類型 說明 market OptionMarket 期權市場類型 US_SECURITY=美股股票期權、HK_SECURITY=港股股票期權seller_type SellerType 賣方策略類型 COVERED_CALL=備兌看漲、CASH_SECURED_PUT=現金擔保賣出看跌(港股僅支持 CASH_SECURED_PUT)sort_type SellerSortType 排序類型 ANNUALIZED_RETURN=年化收益率、INTERVAL_RETURN=區間收益率、ITM_PROBABILITY=行權概率、PREMIUM=權利金is_asc bool 是否升序 默認 False(降序)filter_list list[SellerFilter] 篩選條件列表 多條件為 AND 關係篩選器(SellerFilter)
透過 SellerFilter 構造篩選條件,多個條件為 AND 關係。
SellerFilter(indicator_type, value_list=None, interval_min=None, interval_max=None, min_inclusive=True, max_inclusive=True, security_list=None)1
2參數 類型 說明 indicator_type SellerIndicatorType 篩選因子類型 value_list list 確切值列表(枚舉值或整數) interval_min float 區間下限 interval_max float 區間上限 min_inclusive bool 下限是否閉區間,默認 True max_inclusive bool 上限是否閉區間,默認 True security_list list[str] 證券代碼列表 篩選因子(完整枚舉見 SellerIndicatorType),按篩選方式分組:
篩選方式 用哪個參數 適用因子 語義 security_list security_listOWNER_LIST只看指定標的 value_list value_listSTOCK_CATEGORY、PLATE、EXPIRATION_TYPE、OPTION_EXPIRATION_TYPE、STRIKE_DATE_TIMESTAMP命中枚舉值集合 範圍 interval_min/interval_maxIV、IV_RANK、IV_PERCENTILE、VOLUME、LEFT_DAYS、ANNUALIZED_RETURN、OTM_DEGREE等落在區間內 涉及百分比的因子(如 IV_RANK、IV_PERCENTILE)直接輸入小數,0.2 代表 20%。一個條件只承載一種篩選方式,三種互斥,按因子所屬方式對號入座。`STOCK_CATEGORY` 在 SDK 內置枚舉映射,可直接傳 `value_list=[StockCategory.ETF]`;`EXPIRATION_TYPE` 等可傳枚舉或對應整數。
返回
參數 類型 說明 ret RET_CODE 接口調用結果 data pandas.DataFrame 當 ret == RET_OK,返回篩選結果 str 當 ret != RET_OK,返回錯誤描述 返回 DataFrame 字段:
字段 類型 說明 option str 期權合約代碼 name str 期權名稱 option_type str 期權方向 CALL、PUTstrike_price float 行權價 strike_time str 到期日時間字符串 strike_timestamp float 到期日時間戳(Unix 秒) left_days int 距到期天數 option_price float 期權價格 stock_price float 標的股票價格 premium float 權利金 otm_degree float 價外程度(%) iv float 隱含波動率(%) interval_return float 區間收益率(%) annualized_return float 年化收益率(%) itm_probability float 行權概率(%) striked_interval_return float 行權時區間收益率(%) 僅 Covered Callstriked_annualized_return float 行權時年化收益率(%) 僅 Covered Callowner str 標的股票代碼
Example
from moomoo import *
quote_ctx = OpenQuoteContext(host='127.0.0.1', port=11111)
# 篩選器用法引導(按需取消註釋,構造後傳入 filter_list,多條件為 AND 關係):
# # ① 標的列表篩選 — 只看自選標的
# f_owner = SellerFilter(SellerIndicatorType.OWNER_LIST,
# security_list=['US.TSLA', 'US.AAPL', 'US.NVDA'])
# # ② 確切值篩選 — ETF 標的 + 月期權
# f_category = SellerFilter(SellerIndicatorType.STOCK_CATEGORY,
# value_list=[StockCategory.ETF])
# f_expiry = SellerFilter(SellerIndicatorType.EXPIRATION_TYPE,
# value_list=[ExpirationType.MONTHLY])
# # ③ 範圍篩選 — 距到期 7~30 天、價外程度 0%~15%
# f_days = SellerFilter(SellerIndicatorType.LEFT_DAYS, interval_min=7, interval_max=30)
# f_otm = SellerFilter(SellerIndicatorType.OTM_DEGREE, interval_min=0.0, interval_max=15.0)
ret, data = quote_ctx.get_option_seller_screener(
market=OptionMarket.US_SECURITY,
seller_type=SellerType.COVERED_CALL,
sort_type=SellerSortType.ANNUALIZED_RETURN,
is_asc=False
# filter_list=[f_days, f_otm] # 多條件 AND,傳入上方構造的篩選條件
)
if ret == RET_OK:
print(data)
else:
print('error:', data)
quote_ctx.close()
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
- Output
option name option_type strike_price strike_time strike_timestamp left_days option_price stock_price premium otm_degree iv interval_return annualized_return itm_probability striked_interval_return striked_annualized_return owner
0 US.SOXL260618C235000 SOXL 260618 235.00C CALL 235.0 2026-06-18 1.781755e+09 3 21.850 234.68 2185.0 0.136 234.988 10.266 1074.855 45.724 10.416 1090.597 US.SOXL
1 US.SOXL260618C237500 SOXL 260618 237.50C CALL 237.5 2026-06-18 1.781755e+09 3 20.675 234.68 2067.5 1.201 234.423 9.660 1011.470 43.682 10.978 1149.431 US.SOXL
2 US.SOXL260618C240000 SOXL 260618 240.00C CALL 240.0 2026-06-18 1.781755e+09 3 19.250 234.68 1925.0 2.266 230.652 8.935 935.526 41.678 11.405 1194.071 US.SOXL
3 US.WDS260618C25000 WDS 260618 25.00C CALL 25.0 2026-06-18 1.781755e+09 3 1.875 23.07 187.5 8.365 292.148 8.846 928.963 11.794 17.952 1885.177 US.WDS
4 US.SOXL260618C242500 SOXL 260618 242.50C CALL 242.5 2026-06-18 1.781755e+09 3 18.350 234.68 1835.0 3.332 232.108 8.482 888.077 39.715 12.097 1266.538 US.SOXL
...
2
3
4
5
6
7
# Qot_GetOptionSellerScreener.proto
介紹
獲取期權賣方專區篩選列表
參數
message C2S {
required int32 optionMarket = 1; // Qot_OptionCommon.OptionMarket
required int32 sellerType = 2; // Qot_OptionCommon.SellerType
optional int32 sortType = 3; // Qot_OptionCommon.SellerSortType
optional bool isAsc = 4; // 默認 false
repeated Qot_OptionCommon.SellerIndicator filterList = 5;
}
message Request {
required C2S c2s = 1;
}
2
3
4
5
6
7
8
9
10
11
- 返回
message SellerItem {
required Qot_Common.Security option = 1;
optional string name = 2;
optional int32 optionType = 3; // Qot_Common.OptionType
optional double strikePrice = 4;
optional string strikeTime = 5;
optional double strikeTimestamp = 6;
optional int32 leftDays = 7;
optional double optionPrice = 8;
optional double stockPrice = 9;
optional double premium = 10;
optional double otmDegree = 11; // (%)
optional double iv = 12; // (%)
optional double intervalReturn = 13; // (%)
optional double annualizedReturn = 14; // (%)
optional double itmProbability = 15; // (%)
optional double strikedIntervalReturn = 16; // (%)
optional double strikedAnnualizedReturn = 17; // (%)
optional Qot_Common.Security owner = 18;
}
message S2C {
repeated SellerItem itemList = 1;
}
message Response {
required int32 retType = 1 [default = -400];
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
- 接口調用結果,結構參見 RetType
協議 ID
3314
uint GetOptionSellerScreener(Qot_GetOptionSellerScreener.Request req); virtual void OnReply_GetOptionSellerScreener(MMAPI_Conn client, uint nSerialNo, Qot_GetOptionSellerScreener.Response rsp);
介紹
獲取期權賣方專區篩選列表
參數
message C2S {
required int32 optionMarket = 1; // Qot_OptionCommon.OptionMarket
required int32 sellerType = 2; // Qot_OptionCommon.SellerType
optional int32 sortType = 3; // Qot_OptionCommon.SellerSortType
optional bool isAsc = 4; // 默認 false
repeated Qot_OptionCommon.SellerIndicator filterList = 5;
}
message Request {
required C2S c2s = 1;
}
2
3
4
5
6
7
8
9
10
11
- 返回
message SellerItem {
required Qot_Common.Security option = 1;
optional string name = 2;
optional int32 optionType = 3; // Qot_Common.OptionType
optional double strikePrice = 4;
optional string strikeTime = 5;
optional double strikeTimestamp = 6;
optional int32 leftDays = 7;
optional double optionPrice = 8;
optional double stockPrice = 9;
optional double premium = 10;
optional double otmDegree = 11; // (%)
optional double iv = 12; // (%)
optional double intervalReturn = 13; // (%)
optional double annualizedReturn = 14; // (%)
optional double itmProbability = 15; // (%)
optional double strikedIntervalReturn = 16; // (%)
optional double strikedAnnualizedReturn = 17; // (%)
optional Qot_Common.Security owner = 18;
}
message S2C {
repeated SellerItem itemList = 1;
}
message Response {
required int32 retType = 1 [default = -400];
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
- 接口調用結果,結構參見 RetType
協議 ID
3314
Example
public class Program : MMSPI_Qot, MMSPI_Conn
{
MMAPI_Qot qot = new MMAPI_Qot();
public Program()
{
qot.SetClientInfo("csharp", 1);
qot.SetConnCallback(this);
qot.SetQotCallback(this);
}
public void Start()
{
qot.InitConnect("127.0.0.1", (ushort)11111, false);
}
public void OnInitConnect(MMAPI_Conn client, long errCode, String desc)
{
if (errCode != 0) return;
var c2s = Qot_GetOptionSellerScreener.C2S.CreateBuilder()
// TODO: 按 proto 填充 c2s 字段
.Build();
var req = Qot_GetOptionSellerScreener.Request.CreateBuilder().SetC2S(c2s).Build();
uint seqNo = qot.GetOptionSellerScreener(req);
Console.Write("Send GetOptionSellerScreener: {0}\n", seqNo);
}
public void OnReply_GetOptionSellerScreener(MMAPI_Conn client, uint nSerialNo, Qot_GetOptionSellerScreener.Response rsp)
{
Console.Write("Reply: {0} {1}\n", nSerialNo, rsp.ToString());
}
public static void Main(String[] args)
{
MMAPI.Init();
new Program().Start();
while (true) Thread.Sleep(1000 * 600);
}
}
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
- Output
Send GetOptionSellerScreener: 1
Reply: 1 { "market": 1, "code": "SOXL" }
}
]
}
2
3
4
5
int getOptionSellerScreener(Qot_GetOptionSellerScreener.Request req) onReply_GetOptionSellerScreener(MMAPI_Conn client, int nSerialNo, Qot_GetOptionSellerScreener.Response rsp)
介紹
獲取期權賣方專區篩選列表
參數
message C2S {
required int32 optionMarket = 1; // Qot_OptionCommon.OptionMarket
required int32 sellerType = 2; // Qot_OptionCommon.SellerType
optional int32 sortType = 3; // Qot_OptionCommon.SellerSortType
optional bool isAsc = 4; // 默認 false
repeated Qot_OptionCommon.SellerIndicator filterList = 5;
}
message Request {
required C2S c2s = 1;
}
2
3
4
5
6
7
8
9
10
11
- 返回
message SellerItem {
required Qot_Common.Security option = 1;
optional string name = 2;
optional int32 optionType = 3; // Qot_Common.OptionType
optional double strikePrice = 4;
optional string strikeTime = 5;
optional double strikeTimestamp = 6;
optional int32 leftDays = 7;
optional double optionPrice = 8;
optional double stockPrice = 9;
optional double premium = 10;
optional double otmDegree = 11; // (%)
optional double iv = 12; // (%)
optional double intervalReturn = 13; // (%)
optional double annualizedReturn = 14; // (%)
optional double itmProbability = 15; // (%)
optional double strikedIntervalReturn = 16; // (%)
optional double strikedAnnualizedReturn = 17; // (%)
optional Qot_Common.Security owner = 18;
}
message S2C {
repeated SellerItem itemList = 1;
}
message Response {
required int32 retType = 1 [default = -400];
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
- 接口調用結果,結構參見 RetType
協議 ID
3314
Example
public class Program implements MMSPI_Qot, MMSPI_Conn {
private MMAPI_Conn_Qot qot = new MMAPI_Conn_Qot();
public Program() {
qot.setClientInfo("java", 1);
qot.setConnCallback(this);
qot.setQotCallback(this);
}
public void start() {
qot.initConnect("127.0.0.1", (short) 11111, false);
}
@Override
public void onInitConnect(MMAPI_Conn client, long errCode, String desc) {
if (errCode != 0) return;
Qot_GetOptionSellerScreener.C2S c2s = Qot_GetOptionSellerScreener.C2S.newBuilder()
// TODO: 按 proto 填充 c2s 字段
.build();
Qot_GetOptionSellerScreener.Request req = Qot_GetOptionSellerScreener.Request.newBuilder()
.setC2S(c2s).build();
int seqNo = qot.getOptionSellerScreener(req);
System.out.println("Send getOptionSellerScreener: " + seqNo);
}
@Override
public void onReply_GetOptionSellerScreener(MMAPI_Conn client, int nSerialNo, Qot_GetOptionSellerScreener.Response rsp) {
System.out.println("Reply: " + nSerialNo + " " + rsp.toString());
}
public static void main(String[] args) {
MMAPI.init();
new Program().start();
while (true) {
try { Thread.sleep(1000 * 600); } catch (InterruptedException e) {}
}
}
}
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
- Output
Send getOptionSellerScreener: 1
Reply: 1 { "market": 1, "code": "SOXL" }
}
]
}
2
3
4
5
Moomoo::u32_t GetOptionSellerScreener(const Qot_GetOptionSellerScreener::Request &stReq);
virtual void OnReply_GetOptionSellerScreener(Moomoo::u32_t nSerialNo, const Qot_GetOptionSellerScreener::Response &stRsp) = 0;
介紹
獲取期權賣方專區篩選列表
參數
message C2S {
required int32 optionMarket = 1; // Qot_OptionCommon.OptionMarket
required int32 sellerType = 2; // Qot_OptionCommon.SellerType
optional int32 sortType = 3; // Qot_OptionCommon.SellerSortType
optional bool isAsc = 4; // 默認 false
repeated Qot_OptionCommon.SellerIndicator filterList = 5;
}
message Request {
required C2S c2s = 1;
}
2
3
4
5
6
7
8
9
10
11
- 返回
message SellerItem {
required Qot_Common.Security option = 1;
optional string name = 2;
optional int32 optionType = 3; // Qot_Common.OptionType
optional double strikePrice = 4;
optional string strikeTime = 5;
optional double strikeTimestamp = 6;
optional int32 leftDays = 7;
optional double optionPrice = 8;
optional double stockPrice = 9;
optional double premium = 10;
optional double otmDegree = 11; // (%)
optional double iv = 12; // (%)
optional double intervalReturn = 13; // (%)
optional double annualizedReturn = 14; // (%)
optional double itmProbability = 15; // (%)
optional double strikedIntervalReturn = 16; // (%)
optional double strikedAnnualizedReturn = 17; // (%)
optional Qot_Common.Security owner = 18;
}
message S2C {
repeated SellerItem itemList = 1;
}
message Response {
required int32 retType = 1 [default = -400];
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
- 接口調用結果,結構參見 RetType
協議 ID
3314
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_GetOptionSellerScreener::Request req;
Qot_GetOptionSellerScreener::C2S *c2s = req.mutable_c2s();
// TODO: 按 proto 填充 c2s 字段
m_GetOptionSellerScreenerSerialNo = m_pQotApi->GetOptionSellerScreener(req);
}
virtual void OnReply_GetOptionSellerScreener(Moomoo::u32_t nSerialNo, const Qot_GetOptionSellerScreener::Response &stRsp) {
if (nSerialNo != m_GetOptionSellerScreenerSerialNo) return;
string resp_str;
ProtoBufToBodyData(stRsp, resp_str);
cout << UTF8ToLocal(resp_str) << endl;
}
protected:
MMAPI_Qot *m_pQotApi;
Moomoo::u32_t m_GetOptionSellerScreenerSerialNo = 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
getOptionSellerScreener(qotGetOptionSellerScreener)
介紹
獲取期權賣方專區篩選列表
參數
message C2S {
required int32 optionMarket = 1; // Qot_OptionCommon.OptionMarket
required int32 sellerType = 2; // Qot_OptionCommon.SellerType
optional int32 sortType = 3; // Qot_OptionCommon.SellerSortType
optional bool isAsc = 4; // 默認 false
repeated Qot_OptionCommon.SellerIndicator filterList = 5;
}
message Request {
required C2S c2s = 1;
}
2
3
4
5
6
7
8
9
10
11
- 返回
message SellerItem {
required Qot_Common.Security option = 1;
optional string name = 2;
optional int32 optionType = 3; // Qot_Common.OptionType
optional double strikePrice = 4;
optional string strikeTime = 5;
optional double strikeTimestamp = 6;
optional int32 leftDays = 7;
optional double optionPrice = 8;
optional double stockPrice = 9;
optional double premium = 10;
optional double otmDegree = 11; // (%)
optional double iv = 12; // (%)
optional double intervalReturn = 13; // (%)
optional double annualizedReturn = 14; // (%)
optional double itmProbability = 15; // (%)
optional double strikedIntervalReturn = 16; // (%)
optional double strikedAnnualizedReturn = 17; // (%)
optional Qot_Common.Security owner = 18;
}
message S2C {
repeated SellerItem itemList = 1;
}
message Response {
required int32 retType = 1 [default = -400];
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
- 接口調用結果,結構參見 RetType
協議 ID
3314
Example
import mmWebsocket from "moomoo-api";
import { Common, Qot_OptionCommon } from "moomoo-api/proto";
import beautify from "js-beautify";
function QotGetOptionSellerScreener(){
const { RetType } = Common
const { OptionMarket, SellerType, SellerSortType } = 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,
sellerType: SellerType.SellerType_CoveredCall,
sortType: SellerSortType.SellerSortType_AnnualizedReturn,
},
};
websocket.GetOptionSellerScreener(req)
.then((res)=>{
let { errCode, retMsg, retType, s2c } = res
console.log("GetOptionSellerScreener: 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);
}
QotGetOptionSellerScreener()
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
- Output
GetOptionSellerScreener: errCode 0, retMsg , retType 0
{
"itemList": [
{
"option": { "market": 1, "code": "SOXL260618C235000" },
"name": "SOXL 260618 235.00C",
"optionType": 1,
"strikePrice": 235,
"strikeTime": "2026-06-18",
"strikeTimestamp": 1781755000,
"leftDays": 3,
"optionPrice": 21.85,
"stockPrice": 234.68,
"premium": 2185,
"otmDegree": 0.136,
"iv": 234.988,
"intervalReturn": 10.266,
"annualizedReturn": 1074.855,
"itmProbability": 45.724,
"strikedIntervalReturn": 10.416,
"strikedAnnualizedReturn": 1090.597,
"owner": { "market": 1, "code": "SOXL" }
},
{
"option": { "market": 1, "code": "SOXL260618C237500" },
"name": "SOXL 260618 237.50C",
"optionType": 1,
"strikePrice": 237.5,
"strikeTime": "2026-06-18",
"strikeTimestamp": 1781755000,
"leftDays": 3,
"optionPrice": 20.675,
"stockPrice": 234.68,
"premium": 2067.5,
"otmDegree": 1.201,
"iv": 234.423,
"intervalReturn": 9.66,
"annualizedReturn": 1011.47,
"itmProbability": 43.682,
"strikedIntervalReturn": 10.978,
"strikedAnnualizedReturn": 1149.431,
"owner": { "market": 1, "code": "SOXL" }
}
]
}
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
接口限制
- 30 秒內最多請求 60 次期權賣方專區接口