# 設置異動提醒
- Python
- Proto
- C#
- Java
- C++
- JavaScript
set_option_event_alert(op, alert_list=None)
介紹
新增、修改、刪除或啟用/禁用期權異動提醒。
參數
參數 類型 說明 op AlertOpType 操作類型 ADD=新增、DELETE=刪除、MODIFY=修改、ENABLE=啟用、DISABLE=禁用、DELETE_ALL=刪除全部alert_list OptionEventAlertItem 或 list[OptionEventAlertItem] 提醒條目 新增時不傳 key,修改/刪除時必傳 keyOptionEventAlertItem 各字段:
字段 類型 說明 key int 告警唯一標識(修改/刪除/啟用/禁用時必填) enable bool 告警開關 option_market OptionMarket 監控的期權市場(三選一) watchlist_group_name str 自選股分組名稱(三選一) underlying str 指定標的代碼,如 'US.AAPL'(三選一)option_type OptionType 期權類型(CALL/PUT) side_type_list list[EventTickerType] 成交方向列表 order_type_list list[AlertOrderType] 訂單類型列表 market_cap_range_min float 標的市值下限 market_cap_range_max float 標的市值上限 market_cap_min_inclusive bool 標的市值下限是否閉區間(默認 True) market_cap_max_inclusive bool 標的市值上限是否閉區間(默認 True) expiry_days_range_min float 距到期天數下限 expiry_days_range_max float 距到期天數上限 expiry_days_min_inclusive bool 距到期天數下限是否閉區間(默認 True) expiry_days_max_inclusive bool 距到期天數上限是否閉區間(默認 True) price_range_min float 異動成交價下限 price_range_max float 異動成交價上限 price_min_inclusive bool 異動成交價下限是否閉區間(默認 True) price_max_inclusive bool 異動成交價上限是否閉區間(默認 True) size_range_min float 異動成交量下限(張) size_range_max float 異動成交量上限(張) size_min_inclusive bool 異動成交量下限是否閉區間(默認 True) size_max_inclusive bool 異動成交量上限是否閉區間(默認 True) premium_range_min float 異動成交額下限 premium_range_max float 異動成交額上限 premium_min_inclusive bool 異動成交額下限是否閉區間(默認 True) premium_max_inclusive bool 異動成交額上限是否閉區間(默認 True) iv_range_min float 隱含波動率下限(%) iv_range_max float 隱含波動率上限(%) iv_min_inclusive bool 隱含波動率下限是否閉區間(默認 True) iv_max_inclusive bool 隱含波動率上限是否閉區間(默認 True) earnings_date_begin str 財報時間篩選起始日期(yyyy-MM-dd) earnings_date_end str 財報時間篩選截止日期(yyyy-MM-dd) note str 備註(最多 20 字符)
監控範圍:
option_market、watchlist_group_name、underlying三者互斥,新增時需設置其中之一。返回
參數 類型 說明 ret RET_CODE 接口調用結果 data str 當 ret == RET_OK,返回空字符串 str 當 ret != RET_OK,返回錯誤描述 Example
from futu import *
quote_ctx = OpenQuoteContext(host='127.0.0.1', port=11111)
# 新增一個提醒:監控美股股票期權市場的 CALL 掃單,成交量 > 100(開區間)
item = OptionEventAlertItem(
option_market=OptionMarket.US_SECURITY,
option_type=OptionType.CALL,
order_type_list=[AlertOrderType.SWEEP],
size_range_min=100,
size_min_inclusive=False,
note='test'
)
ret, data = quote_ctx.set_option_event_alert(AlertOpType.ADD, item)
if ret == RET_OK:
print('新增成功')
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
- Output
新增成功
# Qot_SetOptionEventAlert.proto
介紹
新增、修改、刪除或啟用/禁用期權異動提醒
參數
enum AlertOpType {
AlertOpType_Unknown = 0;
AlertOpType_Add = 1;
AlertOpType_Delete = 2;
AlertOpType_Modify = 3;
AlertOpType_Enable = 4;
AlertOpType_Disable = 5;
AlertOpType_DeleteAll = 6;
}
message C2S {
required int32 operType = 1;
repeated Qot_GetOptionEventAlert.EventAlertItem alertList = 2;
}
message Request {
required C2S c2s = 1;
}
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
- 返回
message S2C {
}
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
- 接口調用結果,結構參見 RetType
協議 ID
3309
uint SetOptionEventAlert(Qot_SetOptionEventAlert.Request req); virtual void OnReply_SetOptionEventAlert(FTAPI_Conn client, uint nSerialNo, Qot_SetOptionEventAlert.Response rsp);
介紹
新增、修改、刪除或啟用/禁用期權異動提醒
參數
enum AlertOpType {
AlertOpType_Unknown = 0;
AlertOpType_Add = 1;
AlertOpType_Delete = 2;
AlertOpType_Modify = 3;
AlertOpType_Enable = 4;
AlertOpType_Disable = 5;
AlertOpType_DeleteAll = 6;
}
message C2S {
required int32 operType = 1;
repeated Qot_GetOptionEventAlert.EventAlertItem alertList = 2;
}
message Request {
required C2S c2s = 1;
}
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
- 返回
message S2C {
}
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
- 接口調用結果,結構參見 RetType
協議 ID
3309
int setOptionEventAlert(Qot_SetOptionEventAlert.Request req) onReply_SetOptionEventAlert(FTAPI_Conn client, int nSerialNo, Qot_SetOptionEventAlert.Response rsp)
介紹
新增、修改、刪除或啟用/禁用期權異動提醒
參數
enum AlertOpType {
AlertOpType_Unknown = 0;
AlertOpType_Add = 1;
AlertOpType_Delete = 2;
AlertOpType_Modify = 3;
AlertOpType_Enable = 4;
AlertOpType_Disable = 5;
AlertOpType_DeleteAll = 6;
}
message C2S {
required int32 operType = 1;
repeated Qot_GetOptionEventAlert.EventAlertItem alertList = 2;
}
message Request {
required C2S c2s = 1;
}
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
- 返回
message S2C {
}
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
- 接口調用結果,結構參見 RetType
協議 ID
3309
Futu::u32_t SetOptionEventAlert(const Qot_SetOptionEventAlert::Request &stReq);
virtual void OnReply_SetOptionEventAlert(Futu::u32_t nSerialNo, const Qot_SetOptionEventAlert::Response &stRsp) = 0;
介紹
新增、修改、刪除或啟用/禁用期權異動提醒
參數
enum AlertOpType {
AlertOpType_Unknown = 0;
AlertOpType_Add = 1;
AlertOpType_Delete = 2;
AlertOpType_Modify = 3;
AlertOpType_Enable = 4;
AlertOpType_Disable = 5;
AlertOpType_DeleteAll = 6;
}
message C2S {
required int32 operType = 1;
repeated Qot_GetOptionEventAlert.EventAlertItem alertList = 2;
}
message Request {
required C2S c2s = 1;
}
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
- 返回
message S2C {
}
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
- 接口調用結果,結構參見 RetType
協議 ID
3309
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_SetOptionEventAlert::Request req;
Qot_SetOptionEventAlert::C2S *c2s = req.mutable_c2s();
// TODO: 按 proto 填充 c2s 字段
m_SetOptionEventAlertSerialNo = m_pQotApi->SetOptionEventAlert(req);
}
virtual void OnReply_SetOptionEventAlert(Futu::u32_t nSerialNo, const Qot_SetOptionEventAlert::Response &stRsp) {
if (nSerialNo != m_SetOptionEventAlertSerialNo) return;
string resp_str;
ProtoBufToBodyData(stRsp, resp_str);
cout << UTF8ToLocal(resp_str) << endl;
}
protected:
FTAPI_Qot *m_pQotApi;
Futu::u32_t m_SetOptionEventAlertSerialNo = 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
setOptionEventAlert(qotSetOptionEventAlert)
介紹
新增、修改、刪除或啟用/禁用期權異動提醒
參數
enum AlertOpType {
AlertOpType_Unknown = 0;
AlertOpType_Add = 1;
AlertOpType_Delete = 2;
AlertOpType_Modify = 3;
AlertOpType_Enable = 4;
AlertOpType_Disable = 5;
AlertOpType_DeleteAll = 6;
}
message C2S {
required int32 operType = 1;
repeated Qot_GetOptionEventAlert.EventAlertItem alertList = 2;
}
message Request {
required C2S c2s = 1;
}
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
- 返回
message S2C {
}
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
- 接口調用結果,結構參見 RetType
協議 ID
3309
Example
import ftWebsocket from "futu-api";
import { Common, Qot_Common, Qot_OptionCommon, Qot_GetOptionEvent, Qot_SetOptionEventAlert } from "futu-api/proto";
import beautify from "js-beautify";
function QotSetOptionEventAlert(){
const { RetType } = Common
const { OptionMarket } = Qot_OptionCommon
const { OptionType } = Qot_Common
const { OptionOrderType } = Qot_GetOptionEvent
const { AlertOpType } = Qot_SetOptionEventAlert
let [addr, port, enable_ssl, key] = ["127.0.0.1", 33333, false, '7522027ccf5a06b1'];
let websocket = new ftWebsocket();
websocket.onlogin = (ret, msg)=>{
if (ret) {
// 新增一個異動告警:監控美股股票期權市場的 CALL 掃單,成交量 >= 100
const req = {
c2s: {
operType: AlertOpType.AlertOpType_Add,
alertList: [
{
optionMarket: OptionMarket.OptionMarket_US_Security,
optionType: OptionType.OptionType_Call,
orderTypeList: [OptionOrderType.OptionOrderType_Sweep],
sizeRange: { filterMin: { value: 100, includes: true } },
note: "test",
}
],
},
};
websocket.SetOptionEventAlert(req)
.then((res)=>{
let { errCode, retMsg, retType, s2c } = res
console.log("SetOptionEventAlert: errCode %d, retMsg %s, retType %d", errCode, retMsg, retType);
if(retType == RetType.RetType_Succeed){
console.log("新增成功");
}
})
.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);
}
QotSetOptionEventAlert()
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
- Output
SetOptionEventAlert: errCode 0, retMsg , retType 0
新增成功
2
接口限制
- 30 秒內最多請求 60 次設置異動提醒接口
- Python
- Proto
- C#
- Java
- C++
- JavaScript
set_option_event_alert(op, alert_list=None)
介紹
新增、修改、刪除或啟用/禁用期權異動提醒。
參數
參數 類型 說明 op AlertOpType 操作類型 ADD=新增、DELETE=刪除、MODIFY=修改、ENABLE=啟用、DISABLE=禁用、DELETE_ALL=刪除全部alert_list OptionEventAlertItem 或 list[OptionEventAlertItem] 提醒條目 新增時不傳 key,修改/刪除時必傳 keyOptionEventAlertItem 各字段:
字段 類型 說明 key int 告警唯一標識(修改/刪除/啟用/禁用時必填) enable bool 告警開關 option_market OptionMarket 監控的期權市場(三選一) watchlist_group_name str 自選股分組名稱(三選一) underlying str 指定標的代碼,如 'US.AAPL'(三選一)option_type OptionType 期權類型(CALL/PUT) side_type_list list[EventTickerType] 成交方向列表 order_type_list list[AlertOrderType] 訂單類型列表 market_cap_range_min float 標的市值下限 market_cap_range_max float 標的市值上限 market_cap_min_inclusive bool 標的市值下限是否閉區間(默認 True) market_cap_max_inclusive bool 標的市值上限是否閉區間(默認 True) expiry_days_range_min float 距到期天數下限 expiry_days_range_max float 距到期天數上限 expiry_days_min_inclusive bool 距到期天數下限是否閉區間(默認 True) expiry_days_max_inclusive bool 距到期天數上限是否閉區間(默認 True) price_range_min float 異動成交價下限 price_range_max float 異動成交價上限 price_min_inclusive bool 異動成交價下限是否閉區間(默認 True) price_max_inclusive bool 異動成交價上限是否閉區間(默認 True) size_range_min float 異動成交量下限(張) size_range_max float 異動成交量上限(張) size_min_inclusive bool 異動成交量下限是否閉區間(默認 True) size_max_inclusive bool 異動成交量上限是否閉區間(默認 True) premium_range_min float 異動成交額下限 premium_range_max float 異動成交額上限 premium_min_inclusive bool 異動成交額下限是否閉區間(默認 True) premium_max_inclusive bool 異動成交額上限是否閉區間(默認 True) iv_range_min float 隱含波動率下限(%) iv_range_max float 隱含波動率上限(%) iv_min_inclusive bool 隱含波動率下限是否閉區間(默認 True) iv_max_inclusive bool 隱含波動率上限是否閉區間(默認 True) earnings_date_begin str 財報時間篩選起始日期(yyyy-MM-dd) earnings_date_end str 財報時間篩選截止日期(yyyy-MM-dd) note str 備註(最多 20 字符)
監控範圍:
option_market、watchlist_group_name、underlying三者互斥,新增時需設置其中之一。返回
參數 類型 說明 ret RET_CODE 接口調用結果 data str 當 ret == RET_OK,返回空字符串 str 當 ret != RET_OK,返回錯誤描述 Example
from moomoo import *
quote_ctx = OpenQuoteContext(host='127.0.0.1', port=11111)
# 新增一個提醒:監控美股股票期權市場的 CALL 掃單,成交量 > 100(開區間)
item = OptionEventAlertItem(
option_market=OptionMarket.US_SECURITY,
option_type=OptionType.CALL,
order_type_list=[AlertOrderType.SWEEP],
size_range_min=100,
size_min_inclusive=False,
note='test'
)
ret, data = quote_ctx.set_option_event_alert(AlertOpType.ADD, item)
if ret == RET_OK:
print('新增成功')
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
- Output
新增成功
# Qot_SetOptionEventAlert.proto
介紹
新增、修改、刪除或啟用/禁用期權異動提醒
參數
enum AlertOpType {
AlertOpType_Unknown = 0;
AlertOpType_Add = 1;
AlertOpType_Delete = 2;
AlertOpType_Modify = 3;
AlertOpType_Enable = 4;
AlertOpType_Disable = 5;
AlertOpType_DeleteAll = 6;
}
message C2S {
required int32 operType = 1;
repeated Qot_GetOptionEventAlert.EventAlertItem alertList = 2;
}
message Request {
required C2S c2s = 1;
}
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
- 返回
message S2C {
}
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
- 接口調用結果,結構參見 RetType
協議 ID
3309
uint SetOptionEventAlert(Qot_SetOptionEventAlert.Request req); virtual void OnReply_SetOptionEventAlert(MMAPI_Conn client, uint nSerialNo, Qot_SetOptionEventAlert.Response rsp);
介紹
新增、修改、刪除或啟用/禁用期權異動提醒
參數
enum AlertOpType {
AlertOpType_Unknown = 0;
AlertOpType_Add = 1;
AlertOpType_Delete = 2;
AlertOpType_Modify = 3;
AlertOpType_Enable = 4;
AlertOpType_Disable = 5;
AlertOpType_DeleteAll = 6;
}
message C2S {
required int32 operType = 1;
repeated Qot_GetOptionEventAlert.EventAlertItem alertList = 2;
}
message Request {
required C2S c2s = 1;
}
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
- 返回
message S2C {
}
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
- 接口調用結果,結構參見 RetType
協議 ID
3309
int setOptionEventAlert(Qot_SetOptionEventAlert.Request req) onReply_SetOptionEventAlert(MMAPI_Conn client, int nSerialNo, Qot_SetOptionEventAlert.Response rsp)
介紹
新增、修改、刪除或啟用/禁用期權異動提醒
參數
enum AlertOpType {
AlertOpType_Unknown = 0;
AlertOpType_Add = 1;
AlertOpType_Delete = 2;
AlertOpType_Modify = 3;
AlertOpType_Enable = 4;
AlertOpType_Disable = 5;
AlertOpType_DeleteAll = 6;
}
message C2S {
required int32 operType = 1;
repeated Qot_GetOptionEventAlert.EventAlertItem alertList = 2;
}
message Request {
required C2S c2s = 1;
}
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
- 返回
message S2C {
}
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
- 接口調用結果,結構參見 RetType
協議 ID
3309
Moomoo::u32_t SetOptionEventAlert(const Qot_SetOptionEventAlert::Request &stReq);
virtual void OnReply_SetOptionEventAlert(Moomoo::u32_t nSerialNo, const Qot_SetOptionEventAlert::Response &stRsp) = 0;
介紹
新增、修改、刪除或啟用/禁用期權異動提醒
參數
enum AlertOpType {
AlertOpType_Unknown = 0;
AlertOpType_Add = 1;
AlertOpType_Delete = 2;
AlertOpType_Modify = 3;
AlertOpType_Enable = 4;
AlertOpType_Disable = 5;
AlertOpType_DeleteAll = 6;
}
message C2S {
required int32 operType = 1;
repeated Qot_GetOptionEventAlert.EventAlertItem alertList = 2;
}
message Request {
required C2S c2s = 1;
}
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
- 返回
message S2C {
}
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
- 接口調用結果,結構參見 RetType
協議 ID
3309
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_SetOptionEventAlert::Request req;
Qot_SetOptionEventAlert::C2S *c2s = req.mutable_c2s();
// TODO: 按 proto 填充 c2s 字段
m_SetOptionEventAlertSerialNo = m_pQotApi->SetOptionEventAlert(req);
}
virtual void OnReply_SetOptionEventAlert(Moomoo::u32_t nSerialNo, const Qot_SetOptionEventAlert::Response &stRsp) {
if (nSerialNo != m_SetOptionEventAlertSerialNo) return;
string resp_str;
ProtoBufToBodyData(stRsp, resp_str);
cout << UTF8ToLocal(resp_str) << endl;
}
protected:
MMAPI_Qot *m_pQotApi;
Moomoo::u32_t m_SetOptionEventAlertSerialNo = 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
setOptionEventAlert(qotSetOptionEventAlert)
介紹
新增、修改、刪除或啟用/禁用期權異動提醒
參數
enum AlertOpType {
AlertOpType_Unknown = 0;
AlertOpType_Add = 1;
AlertOpType_Delete = 2;
AlertOpType_Modify = 3;
AlertOpType_Enable = 4;
AlertOpType_Disable = 5;
AlertOpType_DeleteAll = 6;
}
message C2S {
required int32 operType = 1;
repeated Qot_GetOptionEventAlert.EventAlertItem alertList = 2;
}
message Request {
required C2S c2s = 1;
}
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
- 返回
message S2C {
}
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
- 接口調用結果,結構參見 RetType
協議 ID
3309
Example
import mmWebsocket from "moomoo-api";
import { Common, Qot_Common, Qot_OptionCommon, Qot_GetOptionEvent, Qot_SetOptionEventAlert } from "moomoo-api/proto";
import beautify from "js-beautify";
function QotSetOptionEventAlert(){
const { RetType } = Common
const { OptionMarket } = Qot_OptionCommon
const { OptionType } = Qot_Common
const { OptionOrderType } = Qot_GetOptionEvent
const { AlertOpType } = Qot_SetOptionEventAlert
let [addr, port, enable_ssl, key] = ["127.0.0.1", 33333, false, '7522027ccf5a06b1'];
let websocket = new mmWebsocket();
websocket.onlogin = (ret, msg)=>{
if (ret) {
// 新增一個異動告警:監控美股股票期權市場的 CALL 掃單,成交量 >= 100
const req = {
c2s: {
operType: AlertOpType.AlertOpType_Add,
alertList: [
{
optionMarket: OptionMarket.OptionMarket_US_Security,
optionType: OptionType.OptionType_Call,
orderTypeList: [OptionOrderType.OptionOrderType_Sweep],
sizeRange: { filterMin: { value: 100, includes: true } },
note: "test",
}
],
},
};
websocket.SetOptionEventAlert(req)
.then((res)=>{
let { errCode, retMsg, retType, s2c } = res
console.log("SetOptionEventAlert: errCode %d, retMsg %s, retType %d", errCode, retMsg, retType);
if(retType == RetType.RetType_Succeed){
console.log("新增成功");
}
})
.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);
}
QotSetOptionEventAlert()
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
- Output
SetOptionEventAlert: errCode 0, retMsg , retType 0
新增成功
2
接口限制
- 30 秒內最多請求 60 次設置異動提醒接口