# 経済イベントカレンダーの取得
- Python
- Proto
- C#
- Java
- C++
- JavaScript
get_economic_calendar(begin_date, end_date=None, market_list=None, importance=None, count=None, next_page=None)
説明
経済イベントカレンダーを取得します。指定日付範囲内の経済データ発表イベントを返します。イベントタイトル、発表時間、国、重要度、前回値、予想値、実際発表値を含みます。市場と重要度によるフィルタ、ページング照会に対応しています。
パラメータ
パラメータ タイプ 説明 begin_date str 開始日付、フォーマット "yyyy-MM-dd"(必須) end_date str 終了日付、フォーマット "yyyy-MM-dd";未指定時は begin_date 当日のみ照会 market_list list[Market] 市場フィルター(複数選択、HK/US/SH/SG/JP/AU/MY/CA対応)、未指定時は全市場を返す importance EconomicImportance イベント重要度フィルター、デフォルト ALL(全部) count int ページあたり数量、デフォルト 50、最大 100 next_page str ページングマーカー、初回は未指定、以降は前回返却の next_page を指定 戻り値
パラメータ タイプ 説明 ret RET_CODE API呼び出し結果 data pd.DataFrame ret == RET_OK の場合、データを返す str ret != RET_OK の場合、エラー説明を返す - データフォーマット:
フィールド タイプ 説明 title str イベントタイトル(例:"非農業部門雇用者数") timestamp float 発表タイムスタンプ(秒) country str 国名 star str 重要度("LOW"/"MEDIUM"/"HIGH") previous str 前回値(未返却時は "--") consensus str 予想値(未返却時は "--") actual str 実際発表値(未返却時は "--")
- データフォーマット:
Example
from futu import *
quote_ctx = OpenQuoteContext(host='127.0.0.1', port=11111)
ret, data, next_page, has_more = quote_ctx.get_economic_calendar(begin_date='2026-06-23', end_date='2026-06-24', count=2)
if ret == RET_OK:
print(data)
else:
print('error:', data)
quote_ctx.close()
2
3
4
5
6
7
8
9
10
11
- Output
title timestamp country star previous consensus actual
0 日本6月综合PMI初值 1.782175e+09 日本 MEDIUM
1 日本6月制造业PMI初值 1.782175e+09 日本 MEDIUM
2
3
# Qot_GetEconomicCalendar.proto
説明
経済イベントカレンダーを取得します。指定日付範囲内の経済データ発表イベントを返します。イベントタイトル、発表時間、国、重要度星印、前回値、予測値、実際の発表値を含みます。市場と重要度によるフィルタ、ページング照会に対応しています。
パラメータ
// イベント重要度(星評価)
enum Importance {
Importance_All = 0; //全部(デフォルト)
Importance_Low = 1; //一つ星(低)
Importance_Medium = 2; //二つ星(中)
Importance_High = 3; //三つ星(高)
}
// 経済データイベント
message EconomicCalendarItem {
optional string title = 1; // タイトル(例:「非農業部門雇用者数」)
optional double timestamp = 2; // 发布時間戳(秒)
optional string country = 3; // 国名
optional int32 star = 4; // 星評価(重要度 1-3)
optional string previous = 5; // 前回値
optional string consensus = 6; // 予測値
optional string actual = 7; // 実績値(公表値)
}
message C2S {
required string beginDate = 1; // 开始日付,格式"yyyy-MM-dd",按本机系统时区解释
optional string endDate = 2; // 结束日付,格式"yyyy-MM-dd",不传则仅查beginDate当天
repeated int32 marketList = 3; // Qot_Common.QotMarket,マーケットスクリーニング(多选,支持HK/US/CNSH/SG/JP/AU/MY/CA)
optional int32 importance = 4; // Importance,事件重要性スクリーニング,デフォルトAll
optional int32 count = 5; // 每页数量,デフォルト50,最大100
optional string nextPage = 6; // 翻页标记,首次不传,后续带上S2C戻り値的nextPage
}
message S2C {
repeated EconomicCalendarItem itemList = 1; // 经济数据事件リスト
optional string nextPage = 2; // 次ページめくりマーク
optional bool hasMore = 3; // さらにデータがあるか
}
message Request {
required C2S c2s = 1;
}
message Response {
required int32 retType = 1 [default = -400]; //RetType、戻り結果
optional string retMsg = 2;
optional int32 errCode = 3;
optional S2C s2c = 4;
}
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
プロトコルID
3409
uint GetEconomicCalendar(Qot_GetEconomicCalendar.Request req);
virtual void OnReply_GetEconomicCalendar(FTAPI_Conn client, uint nSerialNo, Qot_GetEconomicCalendar.Response rsp);
説明
経済イベントカレンダーを取得します。指定日付範囲内の経済データ発表イベントを返します。イベントタイトル、発表時間、国、重要度星印、前回値、予測値、実際の発表値を含みます。市場と重要度によるフィルタ、ページング照会に対応しています。
パラメータ
// イベント重要度(星評価)
enum Importance {
Importance_All = 0; //全部(デフォルト)
Importance_Low = 1; //一つ星(低)
Importance_Medium = 2; //二つ星(中)
Importance_High = 3; //三つ星(高)
}
// 経済データイベント
message EconomicCalendarItem {
optional string title = 1; // タイトル(例:「非農業部門雇用者数」)
optional double timestamp = 2; // 发布時間戳(秒)
optional string country = 3; // 国名
optional int32 star = 4; // 星評価(重要度 1-3)
optional string previous = 5; // 前回値
optional string consensus = 6; // 予測値
optional string actual = 7; // 実績値(公表値)
}
message C2S {
required string beginDate = 1; // 开始日付,格式"yyyy-MM-dd",按本机系统时区解释
optional string endDate = 2; // 结束日付,格式"yyyy-MM-dd",不传则仅查beginDate当天
repeated int32 marketList = 3; // Qot_Common.QotMarket,マーケットスクリーニング(多选,支持HK/US/CNSH/SG/JP/AU/MY/CA)
optional int32 importance = 4; // Importance,事件重要性スクリーニング,デフォルトAll
optional int32 count = 5; // 每页数量,デフォルト50,最大100
optional string nextPage = 6; // 翻页标记,首次不传,后续带上S2C戻り値的nextPage
}
message S2C {
repeated EconomicCalendarItem itemList = 1; // 经济数据事件リスト
optional string nextPage = 2; // 次ページめくりマーク
optional bool hasMore = 3; // さらにデータがあるか
}
message Request {
required C2S c2s = 1;
}
message Response {
required int32 retType = 1 [default = -400]; //RetType、戻り結果
optional string retMsg = 2;
optional int32 errCode = 3;
optional S2C s2c = 4;
}
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
- API呼び出し結果、構造体については以下を参照 RetType
プロトコルID
3409
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)
{
Console.Write("Qot onInitConnect: ret={0} desc={1} connID={2}
", errCode, desc, client.GetConnectID());
if (errCode != 0)
return;
QotGetEconomicCalendar.C2S c2s = QotGetEconomicCalendar.C2S.CreateBuilder()
.SetBeginDate("2026-06-22")
.SetEndDate("2026-06-22")
.SetCount(3)
.Build();
QotGetEconomicCalendar.Request req = QotGetEconomicCalendar.Request.CreateBuilder().SetC2S(c2s).Build();
uint seqNo = qot.GetEconomicCalendar(req);
Console.Write("Send QotGetEconomicCalendar: {0}
", seqNo);
}
public void OnDisconnect(FTAPI_Conn client, long errCode) {
Console.Write("Qot onDisConnect: {0}
", errCode);
}
public void OnReply_GetEconomicCalendar(FTAPI_Conn client, uint nSerialNo, QotGetEconomicCalendar.Response rsp)
{
Console.Write("Reply: QotGetEconomicCalendar: {0}
", nSerialNo);
if (rsp.RetType == 0 && rsp.HasS2C)
Console.Write("{0}
", rsp.ToString());
}
public static void Main(String[] args) {
FTAPI.Init();
Program program = new Program();
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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
- Output
Send QotGetEconomicCalendar: 3
Reply: QotGetEconomicCalendar: 3
GetEconomicCalendar: errCode 0, retMsg , retType 0
{
"hasMore": false,
"itemList": [
{ "title": "中国至6月22日一年期贷款市场报价利率", "timestamp": 1782090000, "country": "中国", "star": "HIGH" },
{ "title": "中国至6月22日五年期贷款市场报价利率", "timestamp": 1782090000, "country": "中国", "star": "MEDIUM" },
{ "title": "美国至6月22日6个月国债竞拍-投标倍数", "timestamp": 1782142000, "country": "美国", "star": "LOW" }
]
}
2
3
4
5
6
7
8
9
10
11
int getEconomicCalendar(Qot_GetEconomicCalendar.Request req);
onReply_GetEconomicCalendar(FTAPI_Conn client, int nSerialNo, Qot_GetEconomicCalendar.Response rsp)
説明
経済イベントカレンダーを取得します。指定日付範囲内の経済データ発表イベントを返します。イベントタイトル、発表時間、国、重要度星印、前回値、予測値、実際の発表値を含みます。市場と重要度によるフィルタ、ページング照会に対応しています。
パラメータ
// イベント重要度(星評価)
enum Importance {
Importance_All = 0; //全部(デフォルト)
Importance_Low = 1; //一つ星(低)
Importance_Medium = 2; //二つ星(中)
Importance_High = 3; //三つ星(高)
}
// 経済データイベント
message EconomicCalendarItem {
optional string title = 1; // タイトル(例:「非農業部門雇用者数」)
optional double timestamp = 2; // 发布時間戳(秒)
optional string country = 3; // 国名
optional int32 star = 4; // 星評価(重要度 1-3)
optional string previous = 5; // 前回値
optional string consensus = 6; // 予測値
optional string actual = 7; // 実績値(公表値)
}
message C2S {
required string beginDate = 1; // 开始日付,格式"yyyy-MM-dd",按本机系统时区解释
optional string endDate = 2; // 结束日付,格式"yyyy-MM-dd",不传则仅查beginDate当天
repeated int32 marketList = 3; // Qot_Common.QotMarket,マーケットスクリーニング(多选,支持HK/US/CNSH/SG/JP/AU/MY/CA)
optional int32 importance = 4; // Importance,事件重要性スクリーニング,デフォルトAll
optional int32 count = 5; // 每页数量,デフォルト50,最大100
optional string nextPage = 6; // 翻页标记,首次不传,后续带上S2C戻り値的nextPage
}
message S2C {
repeated EconomicCalendarItem itemList = 1; // 经济数据事件リスト
optional string nextPage = 2; // 次ページめくりマーク
optional bool hasMore = 3; // さらにデータがあるか
}
message Request {
required C2S c2s = 1;
}
message Response {
required int32 retType = 1 [default = -400]; //RetType、戻り結果
optional string retMsg = 2;
optional int32 errCode = 3;
optional S2C s2c = 4;
}
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
- API呼び出し結果、構造体については以下を参照 RetType
プロトコルID
3409
Example
public class QotDemo implements FTSPI_Qot, FTSPI_Conn {
FTAPI_Conn_Qot qot = new FTAPI_Conn_Qot();
public QotDemo() {
qot.setClientInfo("javaclient", 1); //设置客户端信息
qot.setConnSpi(this); //设置连接回调
qot.setQotSpi(this); //设置行情回调
}
public void start() {
qot.initConnect("127.0.0.1", (short)11111, false);
}
@Override
public void onInitConnect(FTAPI_Conn client, long errCode, String desc)
{
System.out.printf("Qot onInitConnect: ret=%d desc=%s connID=%d
", errCode, desc, client.getConnectID());
if (errCode != 0)
return;
QotGetEconomicCalendar.C2S c2s = QotGetEconomicCalendar.C2S.newBuilder()
.setBeginDate("2026-06-22")
.setEndDate("2026-06-22")
.setCount(3)
.build();
QotGetEconomicCalendar.Request req = QotGetEconomicCalendar.Request.newBuilder().setC2S(c2s).build();
int seqNo = qot.getEconomicCalendar(req);
System.out.printf("Send QotGetEconomicCalendar: %d
", seqNo);
}
@Override
public void onDisconnect(FTAPI_Conn client, long errCode) {
System.out.printf("Qot onDisConnect: %d
", errCode);
}
@Override
public void onReply_GetEconomicCalendar(FTAPI_Conn client, int nSerialNo, QotGetEconomicCalendar.Response rsp) {
if (rsp.getRetType() != 0) {
System.out.printf("QotGetEconomicCalendar failed: %s
", rsp.getRetMsg());
} else {
try {
String json = JsonFormat.printer().print(rsp);
System.out.printf("Receive QotGetEconomicCalendar: %s
", json);
} catch (InvalidProtocolBufferException e) {
e.printStackTrace();
}
}
}
public static void main(String[] args) {
FTAPI.init();
QotDemo qot = new QotDemo();
qot.start();
while (true) {
try {
Thread.sleep(1000 * 600);
} catch (InterruptedException exc) {
}
}
}
}
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
- Output
Send QotGetEconomicCalendar: 3
Receive QotGetEconomicCalendar: {
"hasMore": false,
"itemList": [
{ "title": "中国至6月22日一年期贷款市场报价利率", "timestamp": 1782090000, "country": "中国", "star": "HIGH" },
{ "title": "中国至6月22日五年期贷款市场报价利率", "timestamp": 1782090000, "country": "中国", "star": "MEDIUM" },
{ "title": "美国至6月22日6个月国债竞拍-投标倍数", "timestamp": 1782142000, "country": "美国", "star": "LOW" }
]
}
2
3
4
5
6
7
8
9
Futu::u32_t GetEconomicCalendar(const Qot_GetEconomicCalendar::Request &stReq);
virtual void OnReply_GetEconomicCalendar(Futu::u32_t nSerialNo, const Qot_GetEconomicCalendar::Response &stRsp) = 0;
概要
プロトコルリクエストとレスポンスの定義
パラメータ
// イベント重要度(星評価)
enum Importance {
Importance_All = 0; //全部(デフォルト)
Importance_Low = 1; //一つ星(低)
Importance_Medium = 2; //二つ星(中)
Importance_High = 3; //三つ星(高)
}
// 経済データイベント
message EconomicCalendarItem {
optional string title = 1; // タイトル(例:「非農業部門雇用者数」)
optional double timestamp = 2; // 发布時間戳(秒)
optional string country = 3; // 国名
optional int32 star = 4; // 星評価(重要度 1-3)
optional string previous = 5; // 前回値
optional string consensus = 6; // 予測値
optional string actual = 7; // 実績値(公表値)
}
message C2S {
required string beginDate = 1; // 开始日付,格式"yyyy-MM-dd",按本机系统时区解释
optional string endDate = 2; // 结束日付,格式"yyyy-MM-dd",不传则仅查beginDate当天
repeated int32 marketList = 3; // Qot_Common.QotMarket,マーケットスクリーニング(多选,支持HK/US/CNSH/SG/JP/AU/MY/CA)
optional int32 importance = 4; // Importance,事件重要性スクリーニング,デフォルトAll
optional int32 count = 5; // 每页数量,デフォルト50,最大100
optional string nextPage = 6; // 翻页标记,首次不传,后续带上S2C戻り値的nextPage
}
message S2C {
repeated EconomicCalendarItem itemList = 1; // 经济数据事件リスト
optional string nextPage = 2; // 次ページめくりマーク
optional bool hasMore = 3; // さらにデータがあるか
}
message Request {
required C2S c2s = 1;
}
message Response {
required int32 retType = 1 [default = -400]; //RetType、戻り結果
optional string retMsg = 2;
optional int32 errCode = 3;
optional S2C s2c = 4;
}
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
- API 呼び出し結果,構造は~を参照: RetType
プロトコル ID
3409
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_GetEconomicCalendar::Request req;
Qot_GetEconomicCalendar::C2S *c2s = req.mutable_c2s();
c2s->set_begindate("2024-06-01");
c2s->set_enddate("2024-06-07");
m_GetEconomicCalendarSerialNo = m_pQotApi->GetEconomicCalendar(req);
}
virtual void OnReply_GetEconomicCalendar(Futu::u32_t nSerialNo, const Qot_GetEconomicCalendar::Response &stRsp) {
if (nSerialNo != m_GetEconomicCalendarSerialNo) return;
string resp_str;
ProtoBufToBodyData(stRsp, resp_str);
cout << UTF8ToLocal(resp_str) << endl;
}
protected:
FTAPI_Qot *m_pQotApi;
Futu::u32_t m_GetEconomicCalendarSerialNo = 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
- Output
{
"retType": 0,
"retMsg": "",
"errCode": 0,
"s2c": {
"itemList": [
{
"title": "Non-Farm Payrolls",
"timestamp": 1717430400.0,
"country": "US",
"star": 3,
"previous": "175K",
"consensus": "185K",
"actual": "272K"
}
],
"hasMore": false
}
}
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
getEconomicCalendar(qotGetEconomicCalendar)
説明
経済イベントカレンダーを取得します。指定日付範囲内の経済データ発表イベントを返します。イベントタイトル、発表時間、国、重要度星印、前回値、予測値、実際の発表値を含みます。市場と重要度によるフィルタ、ページング照会に対応しています。
パラメータ
// イベント重要度(星評価)
enum Importance {
Importance_All = 0; //全部(デフォルト)
Importance_Low = 1; //一つ星(低)
Importance_Medium = 2; //二つ星(中)
Importance_High = 3; //三つ星(高)
}
// 経済データイベント
message EconomicCalendarItem {
optional string title = 1; // タイトル(例:「非農業部門雇用者数」)
optional double timestamp = 2; // 发布時間戳(秒)
optional string country = 3; // 国名
optional int32 star = 4; // 星評価(重要度 1-3)
optional string previous = 5; // 前回値
optional string consensus = 6; // 予測値
optional string actual = 7; // 実績値(公表値)
}
message C2S {
required string beginDate = 1; // 开始日付,格式"yyyy-MM-dd",按本机系统时区解释
optional string endDate = 2; // 结束日付,格式"yyyy-MM-dd",不传则仅查beginDate当天
repeated int32 marketList = 3; // Qot_Common.QotMarket,マーケットスクリーニング(多选,支持HK/US/CNSH/SG/JP/AU/MY/CA)
optional int32 importance = 4; // Importance,事件重要性スクリーニング,デフォルトAll
optional int32 count = 5; // 每页数量,デフォルト50,最大100
optional string nextPage = 6; // 翻页标记,首次不传,后续带上S2C戻り値的nextPage
}
message S2C {
repeated EconomicCalendarItem itemList = 1; // 经济数据事件リスト
optional string nextPage = 2; // 次ページめくりマーク
optional bool hasMore = 3; // さらにデータがあるか
}
message Request {
required C2S c2s = 1;
}
message Response {
required int32 retType = 1 [default = -400]; //RetType、戻り結果
optional string retMsg = 2;
optional int32 errCode = 3;
optional S2C s2c = 4;
}
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
- API呼び出し結果、構造体については以下を参照 RetType
プロトコルID
3409
Example
import ftWebsocket from "futu-api";
import { Common, Qot_Common } from "futu-api/proto";
import beautify from "js-beautify";
function QotGetEconomicCalendar(){
const { RetType } = Common
let [addr, port, enable_ssl, key] = ["127.0.0.1", 11111, false, "xxxxxx"];
let websocket = new ftWebsocket();
websocket.onlogin = (ret, msg)=>{
if (ret) {
const req = {
c2s: {
beginDate: "2026-06-22",
endDate: "2026-06-22",
count: 3,
},
};
websocket.GetEconomicCalendar(req)
.then((res)=>{
let { errCode, retMsg, retType, s2c } = res
console.log("GetEconomicCalendar: 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);
}
QotGetEconomicCalendar()
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
GetEconomicCalendar: errCode 0, retMsg , retType 0
{
"hasMore": false,
"itemList": [
{ "title": "中国至6月22日一年期贷款市场报价利率", "timestamp": 1782090000, "country": "中国", "star": "HIGH" },
{ "title": "中国至6月22日五年期贷款市场报价利率", "timestamp": 1782090000, "country": "中国", "star": "MEDIUM" },
{ "title": "美国至6月22日6个月国债竞拍-投标倍数", "timestamp": 1782142000, "country": "美国", "star": "LOW" }
]
}
2
3
4
5
6
7
8
9
API制限
- 30秒以内に最大60回のリクエストが可能です
- ページネーションリクエストは最初のページのみレート制限にカウントされます
- Python
- Proto
- C#
- Java
- C++
- JavaScript
get_economic_calendar(begin_date, end_date=None, market_list=None, importance=None, count=None, next_page=None)
説明
経済イベントカレンダーを取得します。指定日付範囲内の経済データ発表イベントを返します。イベントタイトル、発表時間、国、重要度、前回値、予想値、実際発表値を含みます。市場と重要度によるフィルタ、ページング照会に対応しています。
パラメータ
パラメータ タイプ 説明 begin_date str 開始日付、フォーマット "yyyy-MM-dd"(必須) end_date str 終了日付、フォーマット "yyyy-MM-dd";未指定時は begin_date 当日のみ照会 market_list list[Market] 市場フィルター(複数選択、HK/US/SH/SG/JP/AU/MY/CA対応)、未指定時は全市場を返す importance EconomicImportance イベント重要度フィルター、デフォルト ALL(全部) count int ページあたり数量、デフォルト 50、最大 100 next_page str ページングマーカー、初回は未指定、以降は前回返却の next_page を指定 戻り値
パラメータ タイプ 説明 ret RET_CODE API呼び出し結果 data pd.DataFrame ret == RET_OK の場合、データを返す str ret != RET_OK の場合、エラー説明を返す - データフォーマット:
フィールド タイプ 説明 title str イベントタイトル(例:"非農業部門雇用者数") timestamp float 発表タイムスタンプ(秒) country str 国名 star str 重要度("LOW"/"MEDIUM"/"HIGH") previous str 前回値(未返却時は "--") consensus str 予想値(未返却時は "--") actual str 実際発表値(未返却時は "--")
- データフォーマット:
Example
from futu import *
quote_ctx = OpenQuoteContext(host='127.0.0.1', port=11111)
ret, data, next_page, has_more = quote_ctx.get_economic_calendar(begin_date='2026-06-23', end_date='2026-06-24', count=2)
if ret == RET_OK:
print(data)
else:
print('error:', data)
quote_ctx.close()
2
3
4
5
6
7
8
9
10
11
- Output
title timestamp country star previous consensus actual
0 日本6月综合PMI初值 1.782175e+09 日本 MEDIUM
1 日本6月制造业PMI初值 1.782175e+09 日本 MEDIUM
2
3
# Qot_GetEconomicCalendar.proto
説明
経済イベントカレンダーを取得します。指定日付範囲内の経済データ発表イベントを返します。イベントタイトル、発表時間、国、重要度星印、前回値、予測値、実際の発表値を含みます。市場と重要度によるフィルタ、ページング照会に対応しています。
パラメータ
// イベント重要度(星評価)
enum Importance {
Importance_All = 0; //全部(デフォルト)
Importance_Low = 1; //一つ星(低)
Importance_Medium = 2; //二つ星(中)
Importance_High = 3; //三つ星(高)
}
// 経済データイベント
message EconomicCalendarItem {
optional string title = 1; // タイトル(例:「非農業部門雇用者数」)
optional double timestamp = 2; // 发布時間戳(秒)
optional string country = 3; // 国名
optional int32 star = 4; // 星評価(重要度 1-3)
optional string previous = 5; // 前回値
optional string consensus = 6; // 予測値
optional string actual = 7; // 実績値(公表値)
}
message C2S {
required string beginDate = 1; // 开始日付,格式"yyyy-MM-dd",按本机系统时区解释
optional string endDate = 2; // 结束日付,格式"yyyy-MM-dd",不传则仅查beginDate当天
repeated int32 marketList = 3; // Qot_Common.QotMarket,マーケットスクリーニング(多选,支持HK/US/CNSH/SG/JP/AU/MY/CA)
optional int32 importance = 4; // Importance,事件重要性スクリーニング,デフォルトAll
optional int32 count = 5; // 每页数量,デフォルト50,最大100
optional string nextPage = 6; // 翻页标记,首次不传,后续带上S2C戻り値的nextPage
}
message S2C {
repeated EconomicCalendarItem itemList = 1; // 经济数据事件リスト
optional string nextPage = 2; // 次ページめくりマーク
optional bool hasMore = 3; // さらにデータがあるか
}
message Request {
required C2S c2s = 1;
}
message Response {
required int32 retType = 1 [default = -400]; //RetType、戻り結果
optional string retMsg = 2;
optional int32 errCode = 3;
optional S2C s2c = 4;
}
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
プロトコルID
3409
uint GetEconomicCalendar(Qot_GetEconomicCalendar.Request req);
virtual void OnReply_GetEconomicCalendar(FTAPI_Conn client, uint nSerialNo, Qot_GetEconomicCalendar.Response rsp);
説明
経済イベントカレンダーを取得します。指定日付範囲内の経済データ発表イベントを返します。イベントタイトル、発表時間、国、重要度星印、前回値、予測値、実際の発表値を含みます。市場と重要度によるフィルタ、ページング照会に対応しています。
パラメータ
// イベント重要度(星評価)
enum Importance {
Importance_All = 0; //全部(デフォルト)
Importance_Low = 1; //一つ星(低)
Importance_Medium = 2; //二つ星(中)
Importance_High = 3; //三つ星(高)
}
// 経済データイベント
message EconomicCalendarItem {
optional string title = 1; // タイトル(例:「非農業部門雇用者数」)
optional double timestamp = 2; // 发布時間戳(秒)
optional string country = 3; // 国名
optional int32 star = 4; // 星評価(重要度 1-3)
optional string previous = 5; // 前回値
optional string consensus = 6; // 予測値
optional string actual = 7; // 実績値(公表値)
}
message C2S {
required string beginDate = 1; // 开始日付,格式"yyyy-MM-dd",按本机系统时区解释
optional string endDate = 2; // 结束日付,格式"yyyy-MM-dd",不传则仅查beginDate当天
repeated int32 marketList = 3; // Qot_Common.QotMarket,マーケットスクリーニング(多选,支持HK/US/CNSH/SG/JP/AU/MY/CA)
optional int32 importance = 4; // Importance,事件重要性スクリーニング,デフォルトAll
optional int32 count = 5; // 每页数量,デフォルト50,最大100
optional string nextPage = 6; // 翻页标记,首次不传,后续带上S2C戻り値的nextPage
}
message S2C {
repeated EconomicCalendarItem itemList = 1; // 经济数据事件リスト
optional string nextPage = 2; // 次ページめくりマーク
optional bool hasMore = 3; // さらにデータがあるか
}
message Request {
required C2S c2s = 1;
}
message Response {
required int32 retType = 1 [default = -400]; //RetType、戻り結果
optional string retMsg = 2;
optional int32 errCode = 3;
optional S2C s2c = 4;
}
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
- API呼び出し結果、構造体については以下を参照 RetType
プロトコルID
3409
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)
{
Console.Write("Qot onInitConnect: ret={0} desc={1} connID={2}
", errCode, desc, client.GetConnectID());
if (errCode != 0)
return;
QotGetEconomicCalendar.C2S c2s = QotGetEconomicCalendar.C2S.CreateBuilder()
.SetBeginDate("2026-06-22")
.SetEndDate("2026-06-22")
.SetCount(3)
.Build();
QotGetEconomicCalendar.Request req = QotGetEconomicCalendar.Request.CreateBuilder().SetC2S(c2s).Build();
uint seqNo = qot.GetEconomicCalendar(req);
Console.Write("Send QotGetEconomicCalendar: {0}
", seqNo);
}
public void OnDisconnect(MMAPI_Conn client, long errCode) {
Console.Write("Qot onDisConnect: {0}
", errCode);
}
public void OnReply_GetEconomicCalendar(MMAPI_Conn client, uint nSerialNo, QotGetEconomicCalendar.Response rsp)
{
Console.Write("Reply: QotGetEconomicCalendar: {0}
", nSerialNo);
if (rsp.RetType == 0 && rsp.HasS2C)
Console.Write("{0}
", rsp.ToString());
}
public static void Main(String[] args) {
MMAPI.Init();
Program program = new Program();
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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
- Output
Send QotGetEconomicCalendar: 3
Reply: QotGetEconomicCalendar: 3
GetEconomicCalendar: errCode 0, retMsg , retType 0
{
"hasMore": false,
"itemList": [
{ "title": "中国至6月22日一年期贷款市场报价利率", "timestamp": 1782090000, "country": "中国", "star": "HIGH" },
{ "title": "中国至6月22日五年期贷款市场报价利率", "timestamp": 1782090000, "country": "中国", "star": "MEDIUM" },
{ "title": "美国至6月22日6个月国债竞拍-投标倍数", "timestamp": 1782142000, "country": "美国", "star": "LOW" }
]
}
2
3
4
5
6
7
8
9
10
11
int getEconomicCalendar(Qot_GetEconomicCalendar.Request req);
onReply_GetEconomicCalendar(FTAPI_Conn client, int nSerialNo, Qot_GetEconomicCalendar.Response rsp)
説明
経済イベントカレンダーを取得します。指定日付範囲内の経済データ発表イベントを返します。イベントタイトル、発表時間、国、重要度星印、前回値、予測値、実際の発表値を含みます。市場と重要度によるフィルタ、ページング照会に対応しています。
パラメータ
// イベント重要度(星評価)
enum Importance {
Importance_All = 0; //全部(デフォルト)
Importance_Low = 1; //一つ星(低)
Importance_Medium = 2; //二つ星(中)
Importance_High = 3; //三つ星(高)
}
// 経済データイベント
message EconomicCalendarItem {
optional string title = 1; // タイトル(例:「非農業部門雇用者数」)
optional double timestamp = 2; // 发布時間戳(秒)
optional string country = 3; // 国名
optional int32 star = 4; // 星評価(重要度 1-3)
optional string previous = 5; // 前回値
optional string consensus = 6; // 予測値
optional string actual = 7; // 実績値(公表値)
}
message C2S {
required string beginDate = 1; // 开始日付,格式"yyyy-MM-dd",按本机系统时区解释
optional string endDate = 2; // 结束日付,格式"yyyy-MM-dd",不传则仅查beginDate当天
repeated int32 marketList = 3; // Qot_Common.QotMarket,マーケットスクリーニング(多选,支持HK/US/CNSH/SG/JP/AU/MY/CA)
optional int32 importance = 4; // Importance,事件重要性スクリーニング,デフォルトAll
optional int32 count = 5; // 每页数量,デフォルト50,最大100
optional string nextPage = 6; // 翻页标记,首次不传,后续带上S2C戻り値的nextPage
}
message S2C {
repeated EconomicCalendarItem itemList = 1; // 经济数据事件リスト
optional string nextPage = 2; // 次ページめくりマーク
optional bool hasMore = 3; // さらにデータがあるか
}
message Request {
required C2S c2s = 1;
}
message Response {
required int32 retType = 1 [default = -400]; //RetType、戻り結果
optional string retMsg = 2;
optional int32 errCode = 3;
optional S2C s2c = 4;
}
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
- API呼び出し結果、構造体については以下を参照 RetType
プロトコルID
3409
Example
public class QotDemo implements MMSPI_Qot, MMSPI_Conn {
MMAPI_Conn_Qot qot = new MMAPI_Conn_Qot();
public QotDemo() {
qot.setClientInfo("javaclient", 1); //设置客户端信息
qot.setConnSpi(this); //设置连接回调
qot.setQotSpi(this); //设置行情回调
}
public void start() {
qot.initConnect("127.0.0.1", (short)11111, false);
}
@Override
public void onInitConnect(MMAPI_Conn client, long errCode, String desc)
{
System.out.printf("Qot onInitConnect: ret=%d desc=%s connID=%d
", errCode, desc, client.getConnectID());
if (errCode != 0)
return;
QotGetEconomicCalendar.C2S c2s = QotGetEconomicCalendar.C2S.newBuilder()
.setBeginDate("2026-06-22")
.setEndDate("2026-06-22")
.setCount(3)
.build();
QotGetEconomicCalendar.Request req = QotGetEconomicCalendar.Request.newBuilder().setC2S(c2s).build();
int seqNo = qot.getEconomicCalendar(req);
System.out.printf("Send QotGetEconomicCalendar: %d
", seqNo);
}
@Override
public void onDisconnect(MMAPI_Conn client, long errCode) {
System.out.printf("Qot onDisConnect: %d
", errCode);
}
@Override
public void onReply_GetEconomicCalendar(MMAPI_Conn client, int nSerialNo, QotGetEconomicCalendar.Response rsp) {
if (rsp.getRetType() != 0) {
System.out.printf("QotGetEconomicCalendar failed: %s
", rsp.getRetMsg());
} else {
try {
String json = JsonFormat.printer().print(rsp);
System.out.printf("Receive QotGetEconomicCalendar: %s
", json);
} catch (InvalidProtocolBufferException e) {
e.printStackTrace();
}
}
}
public static void main(String[] args) {
MMAPI.init();
QotDemo qot = new QotDemo();
qot.start();
while (true) {
try {
Thread.sleep(1000 * 600);
} catch (InterruptedException exc) {
}
}
}
}
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
- Output
Send QotGetEconomicCalendar: 3
Receive QotGetEconomicCalendar: {
"hasMore": false,
"itemList": [
{ "title": "中国至6月22日一年期贷款市场报价利率", "timestamp": 1782090000, "country": "中国", "star": "HIGH" },
{ "title": "中国至6月22日五年期贷款市场报价利率", "timestamp": 1782090000, "country": "中国", "star": "MEDIUM" },
{ "title": "美国至6月22日6个月国债竞拍-投标倍数", "timestamp": 1782142000, "country": "美国", "star": "LOW" }
]
}
2
3
4
5
6
7
8
9
moomoo::u32_t GetEconomicCalendar(const Qot_GetEconomicCalendar::Request &stReq);
virtual void OnReply_GetEconomicCalendar(moomoo::u32_t nSerialNo, const Qot_GetEconomicCalendar::Response &stRsp) = 0;
概要
プロトコルリクエストとレスポンスの定義
パラメータ
// イベント重要度(星評価)
enum Importance {
Importance_All = 0; //全部(デフォルト)
Importance_Low = 1; //一つ星(低)
Importance_Medium = 2; //二つ星(中)
Importance_High = 3; //三つ星(高)
}
// 経済データイベント
message EconomicCalendarItem {
optional string title = 1; // タイトル(例:「非農業部門雇用者数」)
optional double timestamp = 2; // 发布時間戳(秒)
optional string country = 3; // 国名
optional int32 star = 4; // 星評価(重要度 1-3)
optional string previous = 5; // 前回値
optional string consensus = 6; // 予測値
optional string actual = 7; // 実績値(公表値)
}
message C2S {
required string beginDate = 1; // 开始日付,格式"yyyy-MM-dd",按本机系统时区解释
optional string endDate = 2; // 结束日付,格式"yyyy-MM-dd",不传则仅查beginDate当天
repeated int32 marketList = 3; // Qot_Common.QotMarket,マーケットスクリーニング(多选,支持HK/US/CNSH/SG/JP/AU/MY/CA)
optional int32 importance = 4; // Importance,事件重要性スクリーニング,デフォルトAll
optional int32 count = 5; // 每页数量,デフォルト50,最大100
optional string nextPage = 6; // 翻页标记,首次不传,后续带上S2C戻り値的nextPage
}
message S2C {
repeated EconomicCalendarItem itemList = 1; // 经济数据事件リスト
optional string nextPage = 2; // 次ページめくりマーク
optional bool hasMore = 3; // さらにデータがあるか
}
message Request {
required C2S c2s = 1;
}
message Response {
required int32 retType = 1 [default = -400]; //RetType、戻り結果
optional string retMsg = 2;
optional int32 errCode = 3;
optional S2C s2c = 4;
}
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
- API 呼び出し結果,構造は~を参照: RetType
プロトコル ID
3409
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_GetEconomicCalendar::Request req;
Qot_GetEconomicCalendar::C2S *c2s = req.mutable_c2s();
c2s->set_begindate("2024-06-01");
c2s->set_enddate("2024-06-07");
m_GetEconomicCalendarSerialNo = m_pQotApi->GetEconomicCalendar(req);
}
virtual void OnReply_GetEconomicCalendar(moomoo::u32_t nSerialNo, const Qot_GetEconomicCalendar::Response &stRsp) {
if (nSerialNo != m_GetEconomicCalendarSerialNo) return;
string resp_str;
ProtoBufToBodyData(stRsp, resp_str);
cout << UTF8ToLocal(resp_str) << endl;
}
protected:
MMAPI_Qot *m_pQotApi;
moomoo::u32_t m_GetEconomicCalendarSerialNo = 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
- Output
{
"retType": 0,
"retMsg": "",
"errCode": 0,
"s2c": {
"itemList": [
{
"title": "Non-Farm Payrolls",
"timestamp": 1717430400.0,
"country": "US",
"star": 3,
"previous": "175K",
"consensus": "185K",
"actual": "272K"
}
],
"hasMore": false
}
}
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
getEconomicCalendar(qotGetEconomicCalendar)
説明
経済イベントカレンダーを取得します。指定日付範囲内の経済データ発表イベントを返します。イベントタイトル、発表時間、国、重要度星印、前回値、予測値、実際の発表値を含みます。市場と重要度によるフィルタ、ページング照会に対応しています。
パラメータ
// イベント重要度(星評価)
enum Importance {
Importance_All = 0; //全部(デフォルト)
Importance_Low = 1; //一つ星(低)
Importance_Medium = 2; //二つ星(中)
Importance_High = 3; //三つ星(高)
}
// 経済データイベント
message EconomicCalendarItem {
optional string title = 1; // タイトル(例:「非農業部門雇用者数」)
optional double timestamp = 2; // 发布時間戳(秒)
optional string country = 3; // 国名
optional int32 star = 4; // 星評価(重要度 1-3)
optional string previous = 5; // 前回値
optional string consensus = 6; // 予測値
optional string actual = 7; // 実績値(公表値)
}
message C2S {
required string beginDate = 1; // 开始日付,格式"yyyy-MM-dd",按本机系统时区解释
optional string endDate = 2; // 结束日付,格式"yyyy-MM-dd",不传则仅查beginDate当天
repeated int32 marketList = 3; // Qot_Common.QotMarket,マーケットスクリーニング(多选,支持HK/US/CNSH/SG/JP/AU/MY/CA)
optional int32 importance = 4; // Importance,事件重要性スクリーニング,デフォルトAll
optional int32 count = 5; // 每页数量,デフォルト50,最大100
optional string nextPage = 6; // 翻页标记,首次不传,后续带上S2C戻り値的nextPage
}
message S2C {
repeated EconomicCalendarItem itemList = 1; // 经济数据事件リスト
optional string nextPage = 2; // 次ページめくりマーク
optional bool hasMore = 3; // さらにデータがあるか
}
message Request {
required C2S c2s = 1;
}
message Response {
required int32 retType = 1 [default = -400]; //RetType、戻り結果
optional string retMsg = 2;
optional int32 errCode = 3;
optional S2C s2c = 4;
}
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
- API呼び出し結果、構造体については以下を参照 RetType
プロトコルID
3409
Example
import mmWebsocket from "moomoo-api";
import { Common, Qot_Common } from "moomoo-api/proto";
import beautify from "js-beautify";
function QotGetEconomicCalendar(){
const { RetType } = Common
let [addr, port, enable_ssl, key] = ["127.0.0.1", 11111, false, "xxxxxx"];
let websocket = new mmWebsocket();
websocket.onlogin = (ret, msg)=>{
if (ret) {
const req = {
c2s: {
beginDate: "2026-06-22",
endDate: "2026-06-22",
count: 3,
},
};
websocket.GetEconomicCalendar(req)
.then((res)=>{
let { errCode, retMsg, retType, s2c } = res
console.log("GetEconomicCalendar: 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);
}
QotGetEconomicCalendar()
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
GetEconomicCalendar: errCode 0, retMsg , retType 0
{
"hasMore": false,
"itemList": [
{ "title": "中国至6月22日一年期贷款市场报价利率", "timestamp": 1782090000, "country": "中国", "star": "HIGH" },
{ "title": "中国至6月22日五年期贷款市场报价利率", "timestamp": 1782090000, "country": "中国", "star": "MEDIUM" },
{ "title": "美国至6月22日6个月国债竞拍-投标倍数", "timestamp": 1782142000, "country": "美国", "star": "LOW" }
]
}
2
3
4
5
6
7
8
9
API制限
- 30秒以内に最大60回のリクエストが可能です
- ページネーションリクエストは最初のページのみレート制限にカウントされます