# イベントコントラクトマイルストーンリストの取得
- Python
- Proto
- C#
- Java
- C++
- JavaScript
get_event_contract_milestone_list(category=None, competition=None, related_event=None, next_page=None, count=None)
説明
イベントコントラクトのマイルストーンリストを取得します。マイルストーンはイベントタイプのイベントコントラクトにおける重要な時間ノード(例:特定の試合)であり、カテゴリ、イベント、関連イベントによるフィルタとページネーションに対応しています。
パラメータ
パラメータ 型 説明 category str トップレベルカテゴリ、例: 'Sports'competition str イベント名、 filter_competitionから取得related_event str 関連イベントコード next_page str ページネーションマーカー、先頭ページは Noneを指定count int 返却件数の上限 戻り値
パラメータ 型 説明 ret RET_CODE API呼出結果 data pd.DataFrame ret == RET_OK の場合、マイルストーンリストを返します str ret != RET_OK の場合、エラーの説明を返します next_page str 次ページのページネーションマーカー、空の場合は次ページなし 返却される DataFrame のフィールドは以下の通りです:
フィールド 型 説明 milestone_code str マイルストーンコード title str マイルストーン名(多言語) category str トップレベルカテゴリ識別子 type str マイルストーンタイプ、ECMilestoneType を参照 start_date str 開始時間 end_date str 終了時間 primary_event_code str メインイベントコード related_events list 関連イベントコードリスト notification_message str 通知メッセージ(多言語) Example
from futu import *
quote_ctx = OpenQuoteContext(host='127.0.0.1', port=11111)
ret, data, next_page = quote_ctx.get_event_contract_milestone_list(
category='Sports', count=5
)
if ret == RET_OK:
print(data)
print('next_page:', next_page)
else:
print('error:', data)
quote_ctx.close()
2
3
4
5
6
7
8
9
10
11
12
- Output
milestone_code title category type start_date end_date primary_event_code related_events notification_message
0 EC.d8a4c769-6d6b-45b0-90c0-aaa40ffefbbe.MILESTONE France vs Spain Sports SOCCER_TOURNAMENT_MULTI_LEG 2026-07-14 N/A EC.KXWCADVANCE-26JUL14FRAESP.EVENT [EC.KXWCADVANCE-26JUL14FRAESP.EVENT, EC.KXWCGAME-26JUL14FRAESP.EVENT, ...] The game is about to begin.
1 EC.9ed9d180-9fa6-4a26-9b75-36e9bfb1081a.MILESTONE England vs Argentina Sports SOCCER_TOURNAMENT_MULTI_LEG 2026-07-15 N/A EC.KXWCADVANCE-26JUL15ENGARG.EVENT [EC.KXWCADVANCE-26JUL15ENGARG.EVENT, EC.KXWCGAME-26JUL15ENGARG.EVENT, ...] The game is about to begin.
next_page: 5
2
3
4
# Qot_GetEventContractMilestoneList.proto
説明
イベントコントラクトのマイルストーンリストを取得します。
パラメータ
// マイルストーン項目
message MilestoneItem {
required Qot_Common.Security milestoneSecurity = 1; // マイルストーン標的
optional string title = 2; // マイルストーン名(多言語)
optional string category = 3; // トップレベルカテゴリ識別子
optional Qot_Common.EC_MilestoneType type = 4; // マイルストーンタイプ
optional string startDate = 5; // 開始時間
optional string endDate = 6; // 終了時間
optional Qot_Common.Security primaryEventSecurity = 7; // メインイベント標的
repeated Qot_Common.Security relatedEventList = 8; // 関連イベント標的リスト
optional string notificationMessage = 9; // 通知メッセージ(多言語)
}
message C2S {
optional string category = 1; // トップレベルカテゴリ ("SPORTS")
optional string competition = 2; // イベント識別子
optional Qot_Common.Security relatedEvent = 3; // 関連イベント標的、ローカルフィルタ
optional string nextPage = 4; // ページネーションマーカー(先頭ページは省略)
optional int32 count = 5; // 1ページあたりの最大返却数(デフォルト200)
}
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
- 銘柄構造は Security を参照
- 戻り値
message S2C {
repeated MilestoneItem milestoneList = 1;
optional string nextPage = 2; // 空の場合は次ページなし
}
message Response {
required int32 retType = 1 [default = -400]; //RetType,返却結果
optional string retMsg = 2;
optional int32 errCode = 3;
optional S2C s2c = 4;
}
2
3
4
5
6
7
8
9
10
11
- マイルストーンタイプ列挙は EC_MilestoneType を参照
- API呼出結果の構造は RetType を参照
プロトコル ID
3439
データ型
- 銘柄構造は Security を参照
- マイルストーンタイプは ECMilestoneType を参照
uint GetEventContractMilestoneList(GetEventContractMilestoneList.Request req);
virtual void OnReply_GetEventContractMilestoneList(FTAPI_Conn client, uint nSerialNo, GetEventContractMilestoneList.Response rsp);
説明
イベントコントラクトのマイルストーンリストを取得します。
パラメータ
message MilestoneItem {
required Qot_Common.Security milestoneSecurity = 1;
optional string title = 2;
optional string category = 3;
optional Qot_Common.EC_MilestoneType type = 4;
optional string startDate = 5;
optional string endDate = 6;
optional Qot_Common.Security primaryEventSecurity = 7;
repeated Qot_Common.Security relatedEventList = 8;
optional string notificationMessage = 9;
}
message C2S {
optional string category = 1;
optional string competition = 2;
optional Qot_Common.Security relatedEvent = 3;
optional string nextPage = 4;
optional int32 count = 5;
}
message Request {
required C2S c2s = 1;
}
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
- 銘柄構造は Security を参照
- 戻り値
message S2C {
repeated MilestoneItem milestoneList = 1;
optional string nextPage = 2;
}
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
- マイルストーンタイプ列挙は EC_MilestoneType を参照
- API呼出結果の構造は RetType を参照
- 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 = GetEventContractMilestoneList.C2S.CreateBuilder()
.SetCategory("Sports").SetCount(5).Build();
var req = GetEventContractMilestoneList.Request.CreateBuilder().SetC2S(c2s).Build();
uint seqNo = qot.GetEventContractMilestoneList(req);
Console.Write("Send GetEventContractMilestoneList: {0}\n", seqNo);
}
public void OnReply_GetEventContractMilestoneList(FTAPI_Conn client, uint nSerialNo, GetEventContractMilestoneList.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
int getEventContractMilestoneList(QotGetEventContractMilestoneList.Request req);
void onReply_GetEventContractMilestoneList(FTAPI_Conn client, int nSerialNo, QotGetEventContractMilestoneList.Response rsp);
説明
イベントコントラクトのマイルストーンリストを取得します。
パラメータ
message C2S {
optional string category = 1;
optional string competition = 2;
optional Qot_Common.Security relatedEvent = 3;
optional string nextPage = 4;
optional int32 count = 5;
}
message Request {
required C2S c2s = 1;
}
2
3
4
5
6
7
8
9
10
11
- 銘柄構造は Security を参照
- 戻り値
message S2C {
repeated MilestoneItem milestoneList = 1;
optional string nextPage = 2;
}
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
- マイルストーンタイプ列挙は EC_MilestoneType を参照
- API呼出結果の構造は RetType を参照
- 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;
QotGetEventContractMilestoneList.C2S c2s = QotGetEventContractMilestoneList.C2S.newBuilder()
.setCategory("Sports").setCount(5).build();
QotGetEventContractMilestoneList.Request req = QotGetEventContractMilestoneList.Request.newBuilder()
.setC2S(c2s).build();
int seqNo = qot.getEventContractMilestoneList(req);
System.out.println("Send GetEventContractMilestoneList: " + seqNo);
}
@Override
public void onReply_GetEventContractMilestoneList(FTAPI_Conn client, int nSerialNo, QotGetEventContractMilestoneList.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
Futu::u32_t GetEventContractMilestoneList(const Qot_GetEventContractMilestoneList::Request &stReq);
virtual void OnReply_GetEventContractMilestoneList(Futu::u32_t nSerialNo, const Qot_GetEventContractMilestoneList::Response &stRsp) = 0;
説明
イベントコントラクトのマイルストーンリストを取得します。
パラメータ
// マイルストーン項目
message MilestoneItem {
required Qot_Common.Security milestoneSecurity = 1; // マイルストーン標的
optional string title = 2; // マイルストーン名(多言語)
optional string category = 3; // トップレベルカテゴリ識別子
optional Qot_Common.EC_MilestoneType type = 4; // マイルストーンタイプ
optional string startDate = 5; // 開始時間
optional string endDate = 6; // 終了時間
optional Qot_Common.Security primaryEventSecurity = 7; // メインイベント標的
repeated Qot_Common.Security relatedEventList = 8; // 関連イベント標的リスト
optional string notificationMessage = 9; // 通知メッセージ(多言語)
}
message C2S {
optional string category = 1; // トップレベルカテゴリ ("SPORTS")
optional string competition = 2; // イベント識別子
optional Qot_Common.Security relatedEvent = 3; // 関連イベント標的、ローカルフィルタ
optional string nextPage = 4; // ページネーションマーカー(先頭ページは省略)
optional int32 count = 5; // 1ページあたりの最大返却数(デフォルト200)
}
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
- 銘柄構造は Security を参照
- 戻り値
message S2C {
repeated MilestoneItem milestoneList = 1;
optional string nextPage = 2; // 空の場合は次ページなし
}
message Response {
required int32 retType = 1 [default = -400]; //RetType,返却結果
optional string retMsg = 2;
optional int32 errCode = 3;
optional S2C s2c = 4;
}
2
3
4
5
6
7
8
9
10
11
- マイルストーンタイプ列挙は EC_MilestoneType を参照
- API呼出結果の構造は RetType を参照
- Example
class Program : public FTSPI_Qot, public FTSPI_Trd, 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) {
cout << "connect" << endl;
// リクエストメッセージを構築
Qot_GetEventContractMilestoneList::Request req;
Qot_GetEventContractMilestoneList::C2S *c2s = req.mutable_c2s();
c2s->set_category("Sports");
c2s->set_count(5);
m_GetEventContractMilestoneListSerialNo = m_pQotApi->GetEventContractMilestoneList(req);
cout << "Request GetEventContractMilestoneList SerialNo: " << m_GetEventContractMilestoneListSerialNo << endl;
}
virtual void OnReply_GetEventContractMilestoneList(Futu::u32_t nSerialNo, const Qot_GetEventContractMilestoneList::Response &stRsp) {
if (nSerialNo == m_GetEventContractMilestoneListSerialNo)
{
cout << "OnReply_GetEventContractMilestoneList SerialNo: " << nSerialNo << endl;
// 内部構造を解析して出力
// ProtoBufToBodyData と UTF8ToLocal の定義は Sample の tool.h を参照
string resp_str;
ProtoBufToBodyData(stRsp, resp_str);
cout << UTF8ToLocal(resp_str) << endl;
}
}
protected:
FTAPI_Qot *m_pQotApi;
Futu::u32_t m_GetEventContractMilestoneListSerialNo;
};
int32_t main(int32_t argc, char** argv)
{
FTAPI::Init();
{
Program program;
program.Start();
getchar();
}
protobuf::ShutdownProtobufLibrary();
FTAPI::UnInit();
return 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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
- Output
connect
Request GetEventContractMilestoneList SerialNo: 1
OnReply_GetEventContractMilestoneList SerialNo: 1
{
"retType": 0,
"retMsg": "",
"errCode": 0,
"s2c": {
"milestoneList": [
{
"milestoneSecurity": {"market": 101, "code": "EC.d8a4c769-6d6b-45b0-90c0-aaa40ffefbbe.MILESTONE"},
"title": "France vs Spain",
"category": "Sports",
"type": 3,
"startDate": "2026-07-14",
"primaryEventSecurity": {"market": 101, "code": "EC.KXWCADVANCE-26JUL14FRAESP.EVENT"},
"relatedEventList": [
{"market": 101, "code": "EC.KXWCADVANCE-26JUL14FRAESP.EVENT"},
{"market": 101, "code": "EC.KXWCGAME-26JUL14FRAESP.EVENT"},
{"market": 101, "code": "EC.KXWCSPREAD-26JUL14FRAESP.EVENT"}
],
"notificationMessage": "The game is about to begin."
},
{
"milestoneSecurity": {"market": 101, "code": "EC.9ed9d180-9fa6-4a26-9b75-36e9bfb1081a.MILESTONE"},
"title": "England vs Argentina",
"category": "Sports",
"type": 3,
"startDate": "2026-07-15",
"primaryEventSecurity": {"market": 101, "code": "EC.KXWCADVANCE-26JUL15ENGARG.EVENT"},
"relatedEventList": [
{"market": 101, "code": "EC.KXWCADVANCE-26JUL15ENGARG.EVENT"},
{"market": 101, "code": "EC.KXWCGAME-26JUL15ENGARG.EVENT"},
{"market": 101, "code": "EC.KXWCSPREAD-26JUL15ENGARG.EVENT"}
],
"notificationMessage": "The game is about to begin."
}
],
"nextPage": "5"
}
}
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
GetEventContractMilestoneList(req);
説明
イベントコントラクトのマイルストーンリストを取得します。カテゴリ、イベント、関連イベントでフィルタ可能です。
パラメータ
// マイルストーン項目
message MilestoneItem {
required Qot_Common.Security milestoneSecurity = 1; // マイルストーン標的
optional string title = 2; // マイルストーン名(多言語)
optional string category = 3; // トップレベルカテゴリ識別子
optional Qot_Common.EC_MilestoneType type = 4; // マイルストーンタイプ
optional string startDate = 5; // 開始時間
optional string endDate = 6; // 終了時間
optional Qot_Common.Security primaryEventSecurity = 7; // メインイベント標的
repeated Qot_Common.Security relatedEventList = 8; // 関連イベント標的リスト
optional string notificationMessage = 9; // 通知メッセージ(多言語)
}
message C2S {
optional string category = 1; // トップレベルカテゴリ ("SPORTS")
optional string competition = 2; // イベント識別子
optional Qot_Common.Security relatedEvent = 3; // 関連イベント標的、ローカルフィルタ
optional string nextPage = 4; // ページネーションマーカー(先頭ページは省略)
optional int32 count = 5; // 1ページあたりの最大返却数(デフォルト200)
}
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
- 銘柄構造は Security を参照
- 戻り値
message S2C {
repeated MilestoneItem milestoneList = 1;
optional string nextPage = 2; // 空の場合は次ページなし
}
message Response {
required int32 retType = 1 [default = -400]; //RetType,返却結果
optional string retMsg = 2;
optional int32 errCode = 3;
optional S2C s2c = 4;
}
2
3
4
5
6
7
8
9
10
11
- マイルストーンタイプ列挙は EC_MilestoneType を参照
- API呼出結果の構造は RetType を参照
- Example
import ftWebsocket from "futu-api";
import { Common, Qot_Common } from "futu-api/proto";
import beautify from "js-beautify";
function GetEventContractMilestoneList() {
const { RetType } = Common;
let [addr, port, enable_ssl, key] = ["127.0.0.1", 11111, false, ""];
let websocket = new ftWebsocket();
websocket.onlogin = async (ret, msg) => {
if (!ret) { console.log("start error", msg); return; }
try {
const req = { c2s: { category: "Sports", count: 5 } };
let { errCode, retMsg, retType, s2c } = await websocket.GetEventContractMilestoneList(req);
console.log("GetEventContractMilestoneList: errCode %d, retMsg %s, retType %d", errCode, retMsg, retType);
if (retType == RetType.RetType_Succeed) {
console.log(beautify(JSON.stringify(s2c), { indent_size: 2, space_in_empty_paren: true }));
}
} catch (error) {
console.log("error:", error);
}
};
websocket.start(addr, port, enable_ssl, key);
setTimeout(() => { websocket.stop(); console.log("stop"); }, 5000);
}
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
- Output
GetEventContractMilestoneList: errCode 0, retMsg , retType 0
{
"milestoneList": [{
"milestoneSecurity": {
"market": 101,
"code": "EC.d8a4c769-6d6b-45b0-90c0-aaa40ffefbbe.MILESTONE"
},
"title": "France vs Spain",
"category": "Sports",
"type": 3,
"startDate": "2026-07-14",
"primaryEventSecurity": {
"market": 101,
"code": "EC.KXWCADVANCE-26JUL14FRAESP.EVENT"
},
"relatedEventList": [
{ "market": 101, "code": "EC.KXWCADVANCE-26JUL14FRAESP.EVENT" },
{ "market": 101, "code": "EC.KXWCGAME-26JUL14FRAESP.EVENT" },
{ "market": 101, "code": "EC.KXWCSPREAD-26JUL14FRAESP.EVENT" }
],
"notificationMessage": "The game is about to begin."
}, {
"milestoneSecurity": {
"market": 101,
"code": "EC.9ed9d180-9fa6-4a26-9b75-36e9bfb1081a.MILESTONE"
},
"title": "England vs Argentina",
"category": "Sports",
"type": 3,
"startDate": "2026-07-15",
"primaryEventSecurity": {
"market": 101,
"code": "EC.KXWCADVANCE-26JUL15ENGARG.EVENT"
},
"relatedEventList": [
{ "market": 101, "code": "EC.KXWCADVANCE-26JUL15ENGARG.EVENT" },
{ "market": 101, "code": "EC.KXWCGAME-26JUL15ENGARG.EVENT" },
{ "market": 101, "code": "EC.KXWCSPREAD-26JUL15ENGARG.EVENT" }
],
"notificationMessage": "The game is about to begin."
}],
"nextPage": "5"
}
stop
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
APIレート制限
- 30秒間に最大10回までイベントコントラクトマイルストーンリスト取得インターフェースへリクエスト可能
- Python
- Proto
- C#
- Java
- C++
- JavaScript
get_event_contract_milestone_list(category=None, competition=None, related_event=None, next_page=None, count=None)
説明
イベントコントラクトのマイルストーンリストを取得します。マイルストーンはイベントタイプのイベントコントラクトにおける重要な時間ノード(例:特定の試合)であり、カテゴリ、イベント、関連イベントによるフィルタとページネーションに対応しています。
パラメータ
パラメータ 型 説明 category str トップレベルカテゴリ、例: 'Sports'competition str イベント名、 filter_competitionから取得related_event str 関連イベントコード next_page str ページネーションマーカー、先頭ページは Noneを指定count int 返却件数の上限 戻り値
パラメータ 型 説明 ret RET_CODE API呼出結果 data pd.DataFrame ret == RET_OK の場合、マイルストーンリストを返します str ret != RET_OK の場合、エラーの説明を返します next_page str 次ページのページネーションマーカー、空の場合は次ページなし 返却される DataFrame のフィールドは以下の通りです:
フィールド 型 説明 milestone_code str マイルストーンコード title str マイルストーン名(多言語) category str トップレベルカテゴリ識別子 type str マイルストーンタイプ、ECMilestoneType を参照 start_date str 開始時間 end_date str 終了時間 primary_event_code str メインイベントコード related_events list 関連イベントコードリスト notification_message str 通知メッセージ(多言語) Example
from moomoo import *
quote_ctx = OpenQuoteContext(host='127.0.0.1', port=11111)
ret, data, next_page = quote_ctx.get_event_contract_milestone_list(
category='Sports', count=5
)
if ret == RET_OK:
print(data)
print('next_page:', next_page)
else:
print('error:', data)
quote_ctx.close()
2
3
4
5
6
7
8
9
10
11
12
- Output
milestone_code title category type start_date end_date primary_event_code related_events notification_message
0 EC.d8a4c769-6d6b-45b0-90c0-aaa40ffefbbe.MILESTONE France vs Spain Sports SOCCER_TOURNAMENT_MULTI_LEG 2026-07-14 N/A EC.KXWCADVANCE-26JUL14FRAESP.EVENT [EC.KXWCADVANCE-26JUL14FRAESP.EVENT, EC.KXWCGAME-26JUL14FRAESP.EVENT, ...] The game is about to begin.
1 EC.9ed9d180-9fa6-4a26-9b75-36e9bfb1081a.MILESTONE England vs Argentina Sports SOCCER_TOURNAMENT_MULTI_LEG 2026-07-15 N/A EC.KXWCADVANCE-26JUL15ENGARG.EVENT [EC.KXWCADVANCE-26JUL15ENGARG.EVENT, EC.KXWCGAME-26JUL15ENGARG.EVENT, ...] The game is about to begin.
next_page: 5
2
3
4
# Qot_GetEventContractMilestoneList.proto
説明
イベントコントラクトのマイルストーンリストを取得します。
パラメータ
// マイルストーン項目
message MilestoneItem {
required Qot_Common.Security milestoneSecurity = 1; // マイルストーン標的
optional string title = 2; // マイルストーン名(多言語)
optional string category = 3; // トップレベルカテゴリ識別子
optional Qot_Common.EC_MilestoneType type = 4; // マイルストーンタイプ
optional string startDate = 5; // 開始時間
optional string endDate = 6; // 終了時間
optional Qot_Common.Security primaryEventSecurity = 7; // メインイベント標的
repeated Qot_Common.Security relatedEventList = 8; // 関連イベント標的リスト
optional string notificationMessage = 9; // 通知メッセージ(多言語)
}
message C2S {
optional string category = 1; // トップレベルカテゴリ ("SPORTS")
optional string competition = 2; // イベント識別子
optional Qot_Common.Security relatedEvent = 3; // 関連イベント標的、ローカルフィルタ
optional string nextPage = 4; // ページネーションマーカー(先頭ページは省略)
optional int32 count = 5; // 1ページあたりの最大返却数(デフォルト200)
}
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
- 銘柄構造は Security を参照
- 戻り値
message S2C {
repeated MilestoneItem milestoneList = 1;
optional string nextPage = 2; // 空の場合は次ページなし
}
message Response {
required int32 retType = 1 [default = -400]; //RetType,返却結果
optional string retMsg = 2;
optional int32 errCode = 3;
optional S2C s2c = 4;
}
2
3
4
5
6
7
8
9
10
11
- マイルストーンタイプ列挙は EC_MilestoneType を参照
- API呼出結果の構造は RetType を参照
プロトコル ID
3439
データ型
- 銘柄構造は Security を参照
- マイルストーンタイプは ECMilestoneType を参照
uint GetEventContractMilestoneList(GetEventContractMilestoneList.Request req);
virtual void OnReply_GetEventContractMilestoneList(MMAPI_Conn client, uint nSerialNo, GetEventContractMilestoneList.Response rsp);
説明
イベントコントラクトのマイルストーンリストを取得します。
パラメータ
message MilestoneItem {
required Qot_Common.Security milestoneSecurity = 1;
optional string title = 2;
optional string category = 3;
optional Qot_Common.EC_MilestoneType type = 4;
optional string startDate = 5;
optional string endDate = 6;
optional Qot_Common.Security primaryEventSecurity = 7;
repeated Qot_Common.Security relatedEventList = 8;
optional string notificationMessage = 9;
}
message C2S {
optional string category = 1;
optional string competition = 2;
optional Qot_Common.Security relatedEvent = 3;
optional string nextPage = 4;
optional int32 count = 5;
}
message Request {
required C2S c2s = 1;
}
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
- 銘柄構造は Security を参照
- 戻り値
message S2C {
repeated MilestoneItem milestoneList = 1;
optional string nextPage = 2;
}
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
- マイルストーンタイプ列挙は EC_MilestoneType を参照
- API呼出結果の構造は RetType を参照
- 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 = GetEventContractMilestoneList.C2S.CreateBuilder()
.SetCategory("Sports").SetCount(5).Build();
var req = GetEventContractMilestoneList.Request.CreateBuilder().SetC2S(c2s).Build();
uint seqNo = qot.GetEventContractMilestoneList(req);
Console.Write("Send GetEventContractMilestoneList: {0}\n", seqNo);
}
public void OnReply_GetEventContractMilestoneList(MMAPI_Conn client, uint nSerialNo, GetEventContractMilestoneList.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
int getEventContractMilestoneList(QotGetEventContractMilestoneList.Request req);
void onReply_GetEventContractMilestoneList(MMAPI_Conn client, int nSerialNo, QotGetEventContractMilestoneList.Response rsp);
説明
イベントコントラクトのマイルストーンリストを取得します。
パラメータ
message C2S {
optional string category = 1;
optional string competition = 2;
optional Qot_Common.Security relatedEvent = 3;
optional string nextPage = 4;
optional int32 count = 5;
}
message Request {
required C2S c2s = 1;
}
2
3
4
5
6
7
8
9
10
11
- 銘柄構造は Security を参照
- 戻り値
message S2C {
repeated MilestoneItem milestoneList = 1;
optional string nextPage = 2;
}
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
- マイルストーンタイプ列挙は EC_MilestoneType を参照
- API呼出結果の構造は RetType を参照
- 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;
QotGetEventContractMilestoneList.C2S c2s = QotGetEventContractMilestoneList.C2S.newBuilder()
.setCategory("Sports").setCount(5).build();
QotGetEventContractMilestoneList.Request req = QotGetEventContractMilestoneList.Request.newBuilder()
.setC2S(c2s).build();
int seqNo = qot.getEventContractMilestoneList(req);
System.out.println("Send GetEventContractMilestoneList: " + seqNo);
}
@Override
public void onReply_GetEventContractMilestoneList(MMAPI_Conn client, int nSerialNo, QotGetEventContractMilestoneList.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
moomoo::u32_t GetEventContractMilestoneList(const Qot_GetEventContractMilestoneList::Request &stReq);
virtual void OnReply_GetEventContractMilestoneList(moomoo::u32_t nSerialNo, const Qot_GetEventContractMilestoneList::Response &stRsp) = 0;
説明
イベントコントラクトのマイルストーンリストを取得します。
パラメータ
// マイルストーン項目
message MilestoneItem {
required Qot_Common.Security milestoneSecurity = 1; // マイルストーン標的
optional string title = 2; // マイルストーン名(多言語)
optional string category = 3; // トップレベルカテゴリ識別子
optional Qot_Common.EC_MilestoneType type = 4; // マイルストーンタイプ
optional string startDate = 5; // 開始時間
optional string endDate = 6; // 終了時間
optional Qot_Common.Security primaryEventSecurity = 7; // メインイベント標的
repeated Qot_Common.Security relatedEventList = 8; // 関連イベント標的リスト
optional string notificationMessage = 9; // 通知メッセージ(多言語)
}
message C2S {
optional string category = 1; // トップレベルカテゴリ ("SPORTS")
optional string competition = 2; // イベント識別子
optional Qot_Common.Security relatedEvent = 3; // 関連イベント標的、ローカルフィルタ
optional string nextPage = 4; // ページネーションマーカー(先頭ページは省略)
optional int32 count = 5; // 1ページあたりの最大返却数(デフォルト200)
}
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
- 銘柄構造は Security を参照
- 戻り値
message S2C {
repeated MilestoneItem milestoneList = 1;
optional string nextPage = 2; // 空の場合は次ページなし
}
message Response {
required int32 retType = 1 [default = -400]; //RetType,返却結果
optional string retMsg = 2;
optional int32 errCode = 3;
optional S2C s2c = 4;
}
2
3
4
5
6
7
8
9
10
11
- マイルストーンタイプ列挙は EC_MilestoneType を参照
- API呼出結果の構造は RetType を参照
- Example
class Program : public MMSPI_Qot, public MMSPI_Trd, 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) {
cout << "connect" << endl;
// リクエストメッセージを構築
Qot_GetEventContractMilestoneList::Request req;
Qot_GetEventContractMilestoneList::C2S *c2s = req.mutable_c2s();
c2s->set_category("Sports");
c2s->set_count(5);
m_GetEventContractMilestoneListSerialNo = m_pQotApi->GetEventContractMilestoneList(req);
cout << "Request GetEventContractMilestoneList SerialNo: " << m_GetEventContractMilestoneListSerialNo << endl;
}
virtual void OnReply_GetEventContractMilestoneList(moomoo::u32_t nSerialNo, const Qot_GetEventContractMilestoneList::Response &stRsp) {
if (nSerialNo == m_GetEventContractMilestoneListSerialNo)
{
cout << "OnReply_GetEventContractMilestoneList SerialNo: " << nSerialNo << endl;
// 内部構造を解析して出力
// ProtoBufToBodyData と UTF8ToLocal の定義は Sample の tool.h を参照
string resp_str;
ProtoBufToBodyData(stRsp, resp_str);
cout << UTF8ToLocal(resp_str) << endl;
}
}
protected:
MMAPI_Qot *m_pQotApi;
moomoo::u32_t m_GetEventContractMilestoneListSerialNo;
};
int32_t main(int32_t argc, char** argv)
{
MMAPI::Init();
{
Program program;
program.Start();
getchar();
}
protobuf::ShutdownProtobufLibrary();
MMAPI::UnInit();
return 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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
- Output
connect
Request GetEventContractMilestoneList SerialNo: 1
OnReply_GetEventContractMilestoneList SerialNo: 1
{
"retType": 0,
"retMsg": "",
"errCode": 0,
"s2c": {
"milestoneList": [
{
"milestoneSecurity": {"market": 101, "code": "EC.d8a4c769-6d6b-45b0-90c0-aaa40ffefbbe.MILESTONE"},
"title": "France vs Spain",
"category": "Sports",
"type": 3,
"startDate": "2026-07-14",
"primaryEventSecurity": {"market": 101, "code": "EC.KXWCADVANCE-26JUL14FRAESP.EVENT"},
"relatedEventList": [
{"market": 101, "code": "EC.KXWCADVANCE-26JUL14FRAESP.EVENT"},
{"market": 101, "code": "EC.KXWCGAME-26JUL14FRAESP.EVENT"},
{"market": 101, "code": "EC.KXWCSPREAD-26JUL14FRAESP.EVENT"}
],
"notificationMessage": "The game is about to begin."
},
{
"milestoneSecurity": {"market": 101, "code": "EC.9ed9d180-9fa6-4a26-9b75-36e9bfb1081a.MILESTONE"},
"title": "England vs Argentina",
"category": "Sports",
"type": 3,
"startDate": "2026-07-15",
"primaryEventSecurity": {"market": 101, "code": "EC.KXWCADVANCE-26JUL15ENGARG.EVENT"},
"relatedEventList": [
{"market": 101, "code": "EC.KXWCADVANCE-26JUL15ENGARG.EVENT"},
{"market": 101, "code": "EC.KXWCGAME-26JUL15ENGARG.EVENT"},
{"market": 101, "code": "EC.KXWCSPREAD-26JUL15ENGARG.EVENT"}
],
"notificationMessage": "The game is about to begin."
}
],
"nextPage": "5"
}
}
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
GetEventContractMilestoneList(req);
説明
イベントコントラクトのマイルストーンリストを取得します。カテゴリ、イベント、関連イベントでフィルタ可能です。
パラメータ
// マイルストーン項目
message MilestoneItem {
required Qot_Common.Security milestoneSecurity = 1; // マイルストーン標的
optional string title = 2; // マイルストーン名(多言語)
optional string category = 3; // トップレベルカテゴリ識別子
optional Qot_Common.EC_MilestoneType type = 4; // マイルストーンタイプ
optional string startDate = 5; // 開始時間
optional string endDate = 6; // 終了時間
optional Qot_Common.Security primaryEventSecurity = 7; // メインイベント標的
repeated Qot_Common.Security relatedEventList = 8; // 関連イベント標的リスト
optional string notificationMessage = 9; // 通知メッセージ(多言語)
}
message C2S {
optional string category = 1; // トップレベルカテゴリ ("SPORTS")
optional string competition = 2; // イベント識別子
optional Qot_Common.Security relatedEvent = 3; // 関連イベント標的、ローカルフィルタ
optional string nextPage = 4; // ページネーションマーカー(先頭ページは省略)
optional int32 count = 5; // 1ページあたりの最大返却数(デフォルト200)
}
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
- 銘柄構造は Security を参照
- 戻り値
message S2C {
repeated MilestoneItem milestoneList = 1;
optional string nextPage = 2; // 空の場合は次ページなし
}
message Response {
required int32 retType = 1 [default = -400]; //RetType,返却結果
optional string retMsg = 2;
optional int32 errCode = 3;
optional S2C s2c = 4;
}
2
3
4
5
6
7
8
9
10
11
- マイルストーンタイプ列挙は EC_MilestoneType を参照
- API呼出結果の構造は RetType を参照
- Example
import mmWebsocket from "moomoo-api";
import { Common, Qot_Common } from "moomoo-api/proto";
import beautify from "js-beautify";
function GetEventContractMilestoneList() {
const { RetType } = Common;
let [addr, port, enable_ssl, key] = ["127.0.0.1", 11111, false, ""];
let websocket = new mmWebsocket();
websocket.onlogin = async (ret, msg) => {
if (!ret) { console.log("start error", msg); return; }
try {
const req = { c2s: { category: "Sports", count: 5 } };
let { errCode, retMsg, retType, s2c } = await websocket.GetEventContractMilestoneList(req);
console.log("GetEventContractMilestoneList: errCode %d, retMsg %s, retType %d", errCode, retMsg, retType);
if (retType == RetType.RetType_Succeed) {
console.log(beautify(JSON.stringify(s2c), { indent_size: 2, space_in_empty_paren: true }));
}
} catch (error) {
console.log("error:", error);
}
};
websocket.start(addr, port, enable_ssl, key);
setTimeout(() => { websocket.stop(); console.log("stop"); }, 5000);
}
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
- Output
GetEventContractMilestoneList: errCode 0, retMsg , retType 0
{
"milestoneList": [{
"milestoneSecurity": {
"market": 101,
"code": "EC.d8a4c769-6d6b-45b0-90c0-aaa40ffefbbe.MILESTONE"
},
"title": "France vs Spain",
"category": "Sports",
"type": 3,
"startDate": "2026-07-14",
"primaryEventSecurity": {
"market": 101,
"code": "EC.KXWCADVANCE-26JUL14FRAESP.EVENT"
},
"relatedEventList": [
{ "market": 101, "code": "EC.KXWCADVANCE-26JUL14FRAESP.EVENT" },
{ "market": 101, "code": "EC.KXWCGAME-26JUL14FRAESP.EVENT" },
{ "market": 101, "code": "EC.KXWCSPREAD-26JUL14FRAESP.EVENT" }
],
"notificationMessage": "The game is about to begin."
}, {
"milestoneSecurity": {
"market": 101,
"code": "EC.9ed9d180-9fa6-4a26-9b75-36e9bfb1081a.MILESTONE"
},
"title": "England vs Argentina",
"category": "Sports",
"type": 3,
"startDate": "2026-07-15",
"primaryEventSecurity": {
"market": 101,
"code": "EC.KXWCADVANCE-26JUL15ENGARG.EVENT"
},
"relatedEventList": [
{ "market": 101, "code": "EC.KXWCADVANCE-26JUL15ENGARG.EVENT" },
{ "market": 101, "code": "EC.KXWCGAME-26JUL15ENGARG.EVENT" },
{ "market": 101, "code": "EC.KXWCSPREAD-26JUL15ENGARG.EVENT" }
],
"notificationMessage": "The game is about to begin."
}],
"nextPage": "5"
}
stop
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
APIレート制限
- 30秒間に最大10回までイベントコントラクトマイルストーンリスト取得インターフェースへリクエスト可能