# 決算日前後の価格変動を取得
- Python
- Proto
- C#
- Java
- C++
- JavaScript
get_financials_earnings_price_move(code, period_count=None)
説明
決算日前後の価格変動を取得
パラメータ
パラメータ 型 説明 code str 銘柄コード period_count int 決算期間数 デフォルト 10、範囲 [1, 50]戻り値
パラメータ 型 説明 ret RET_CODE API呼び出し結果 data pd.DataFrame ret == RET_OK の場合、取引日ごとに展開した明細データを返します str ret != RET_OK の場合、エラーの説明を返します 各行に決算メタ情報と当日の相場データが含まれます:
フィールド 型 説明 fiscal_year int 会計年度 例:2024financial_type F10Type 決算種別 0=不明、1=Q1、2=Q2、3=Q3、4=Q4、7=通年、9=四半期などperiod_text str 決算期間 例:"2024/Q3"、"2024/FY"pub_trading_day_str str 決算発表日対応取引日 形式:yyyy-MM-dd;対応市場タイムゾーンpub_type EarningsPubTimeType 決算発表時間種別 0=不明、1=寄り前、2=引け後、3=立会中price_info_index int 決算発表日のitemList内インデックス 0始まり;-1はデータなしday_offset int 決算発表日からのオフセット日数 負=発表前、0=発表当日、正=発表後trading_day_str str 取引日 形式:yyyy-MM-dd;対応市場タイムゾーンclose_price float 終値 open_price float 始値 highest_price float 高値 lowest_price float 安値 last_close_price float 前日終値 option_iv float インプライドボラティリティ パーセント前の値、例:12.34は12.34%を意味するoption_hv float ヒストリカルボラティリティ パーセント前の値、例:12.34は12.34%を意味する
Example
from futu import *
quote_ctx = OpenQuoteContext(host='127.0.0.1', port=11111)
ret, data = quote_ctx.get_financials_earnings_price_move("HK.00700", period_count=2)
if ret == RET_OK:
print(data)
print(data['period_text'][0])
else:
print('error:', data)
quote_ctx.close()
2
3
4
5
6
7
8
9
10
- Output
fiscal_year financial_type ... option_iv option_hv
0 2026 1 ... 31.829 32.220
1 2026 1 ... 33.173 33.720
2 2026 1 ... 32.963 30.355
3 2026 1 ... NaN NaN
4 2025 4 ... 35.804 37.891
5 2025 4 ... 35.845 37.478
6 2025 4 ... 38.504 37.580
7 2025 4 ... 35.518 38.175
8 2025 4 ... 34.739 37.446
9 2025 4 ... 34.248 37.558
10 2025 4 ... 31.682 44.855
11 2025 4 ... 30.907 43.536
12 2025 4 ... 34.614 43.426
13 2025 4 ... 33.617 44.177
14 2025 4 ... 34.503 42.810
[15 rows x 17 columns]
2026/Q1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
# Qot_GetFinancialsEarningsPriceMove.proto
説明
決算日前後の価格変動を取得
パラメータ
message C2S
{
required Qot_Common.Security security = 1; // 銘柄
optional int32 periodCount = 2; // 決算期間数、デフォルト 10、範囲 [1, 50]
}
message Request
{
required C2S c2s = 1;
}
2
3
4
5
6
7
8
9
10
- 銘柄構造については Security 参照
- 戻り値
// 1取引日分の株価データ
message PricePerformanceRow
{
optional int64 tradingDay = 1; // 取引日タイムスタンプ(秒)
optional string tradingDayStr = 2; // 取引日文字列、形式 YYYY-MM-DD、対応市場タイムゾーン
optional double closePrice = 3; // 終値
optional double openPrice = 4; // 始値
optional double highestPrice = 5; // 高値
optional double lowestPrice = 6; // 安値
optional double lastClosePrice = 7; // 前日終値
optional double optionIV = 8; // インプライドボラティリティ(パーセント前の値、12.34は12.34%)
optional double optionHV = 9; // ヒストリカルボラティリティ(パーセント前の値、12.34は12.34%)
}
// 単期決算期間の相場データ、決算メタ情報と決算日前後の取引日価格系列を含む
message ReportCycleQuote
{
optional int32 fiscalYear = 1; // 会計年度(例:2024)
optional int32 financialType = 2; // 決算種別、Qot_Common.F10Type 定義参照
optional string periodText = 3; // 決算期間(例:"2024/Q3"、"2024/FY")
optional int64 pubTradingDay = 4; // 決算発表日の取引日タイムスタンプ(秒)
optional string pubTradingDayStr = 5; // 決算発表取引日文字列、形式 YYYY-MM-DD、対応市場タイムゾーン
optional Qot_Common.EarningsPubTimeType pubType = 6; // 決算発表時間種別、Qot_Common.EarningsPubTimeType 定義参照
optional int32 priceInfoIndex = 7; // itemList 内の決算発表当日のインデックス(0-based);-1 はデータなし
repeated PricePerformanceRow itemList = 8; // 決算日前後の取引日相場リスト(時系列昇順)
}
message S2C
{
repeated ReportCycleQuote detailList = 1; // 各決算期間の詳細相場データリスト、決算発表日降順
}
message Response
{
required int32 retType = 1 [default = -400]; // 戻り値の種別、Common.RetType 参照、0=成功、負数=失敗
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
- API呼び出し結果の構造については RetType 参照
- 決算種別については F10Type 参照
- 決算発表時間種別については EarningsPubTimeType 参照
プロトコル ID
3225
uint GetFinancialsEarningsPriceMove(QotGetFinancialsEarningsPriceMove.Request req);
virtual void OnReply_GetFinancialsEarningsPriceMove(FTAPI_Conn client, uint nSerialNo, QotGetFinancialsEarningsPriceMove.Response rsp);
説明
決算日前後の価格変動を取得
パラメータ
message C2S
{
required Qot_Common.Security security = 1; // 銘柄
optional int32 periodCount = 2; // 決算期間数、デフォルト 10、範囲 [1, 50]
}
message Request
{
required C2S c2s = 1;
}
2
3
4
5
6
7
8
9
10
- 銘柄構造については Security 参照
- 戻り値
// 1取引日分の株価データ
message PricePerformanceRow
{
optional int64 tradingDay = 1; // 取引日タイムスタンプ(秒)
optional string tradingDayStr = 2; // 取引日文字列、形式 YYYY-MM-DD、対応市場タイムゾーン
optional double closePrice = 3; // 終値
optional double openPrice = 4; // 始値
optional double highestPrice = 5; // 高値
optional double lowestPrice = 6; // 安値
optional double lastClosePrice = 7; // 前日終値
optional double optionIV = 8; // インプライドボラティリティ(パーセント前の値、12.34は12.34%)
optional double optionHV = 9; // ヒストリカルボラティリティ(パーセント前の値、12.34は12.34%)
}
// 単期決算期間の相場データ、決算メタ情報と決算日前後の取引日価格系列を含む
message ReportCycleQuote
{
optional int32 fiscalYear = 1; // 会計年度(例:2024)
optional int32 financialType = 2; // 決算種別、Qot_Common.F10Type 定義参照
optional string periodText = 3; // 決算期間(例:"2024/Q3"、"2024/FY")
optional int64 pubTradingDay = 4; // 決算発表日の取引日タイムスタンプ(秒)
optional string pubTradingDayStr = 5; // 決算発表取引日文字列、形式 YYYY-MM-DD、対応市場タイムゾーン
optional Qot_Common.EarningsPubTimeType pubType = 6; // 決算発表時間種別、Qot_Common.EarningsPubTimeType 定義参照
optional int32 priceInfoIndex = 7; // itemList 内の決算発表当日のインデックス(0-based);-1 はデータなし
repeated PricePerformanceRow itemList = 8; // 決算日前後の取引日相場リスト(時系列昇順)
}
message S2C
{
repeated ReportCycleQuote detailList = 1; // 各決算期間の詳細相場データリスト、決算発表日降順
}
message Response
{
required int32 retType = 1 [default = -400]; // 戻り値の種別、Common.RetType 参照、0=成功、負数=失敗
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
- API呼び出し結果の構造については RetType 参照
- 決算種別については F10Type 参照
- 決算発表時間種別については EarningsPubTimeType 参照
- 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}\n", errCode, desc, client.GetConnectID());
if (errCode != 0)
return;
QotCommon.Security sec = QotCommon.Security.CreateBuilder()
.SetMarket((int)QotCommon.QotMarket.QotMarket_HK_Security)
.SetCode("00700")
.Build();
QotGetFinancialsEarningsPriceMove.C2S c2s = QotGetFinancialsEarningsPriceMove.C2S.CreateBuilder()
.SetSecurity(sec)
.Build();
QotGetFinancialsEarningsPriceMove.Request req = QotGetFinancialsEarningsPriceMove.Request.CreateBuilder().SetC2S(c2s).Build();
uint seqNo = qot.GetFinancialsEarningsPriceMove(req);
Console.Write("Send QotGetFinancialsEarningsPriceMove: {0}\n", seqNo);
}
public void OnDisconnect(FTAPI_Conn client, long errCode)
{
Console.Write("Qot onDisConnect: {0}\n", errCode);
}
public void OnReply_GetFinancialsEarningsPriceMove(FTAPI_Conn client, uint nSerialNo, QotGetFinancialsEarningsPriceMove.Response rsp)
{
Console.Write("Reply: QotGetFinancialsEarningsPriceMove: {0} {1}\n", nSerialNo, rsp.ToString());
Console.Write("detailList count: {0}\n", rsp.S2C.DetailListCount);
}
public static void Main(String[] args)
{
FTAPI.Init();
Program qot = new Program();
qot.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
55
56
57
- Output
Qot onInitConnect: ret=0 desc= connID=7459212541089800422
Send QotGetFinancialsEarningsPriceMove: 3
Reply: QotGetFinancialsEarningsPriceMove: 3 retType: 0
retMsg: ""
errCode: 0
s2c {
detailList {
fiscalYear: 2026
financialType: 1
periodText: "2026/Q1"
pubTradingDay: 1778601600
pubTradingDayStr: "2026-05-13"
pubType: EarningsPubTimeType_Unknown
priceInfoIndex: 5
itemList {
tradingDay: 1777996800
tradingDayStr: "2026-05-06"
closePrice: 463
openPrice: 470.6
highestPrice: 473.4
lowestPrice: 460.2
lastClosePrice: 472.2
optionIV: 31.829
optionHV: 32.22
}
itemList {
//...
}
}
detailList {
//...
}
}
detailList count: 10
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
int getFinancialsEarningsPriceMove(QotGetFinancialsEarningsPriceMove.Request req);
void onReply_GetFinancialsEarningsPriceMove(FTAPI_Conn client, int nSerialNo, QotGetFinancialsEarningsPriceMove.Response rsp);
説明
決算日前後の価格変動を取得
パラメータ
message C2S
{
required Qot_Common.Security security = 1; // 銘柄
optional int32 periodCount = 2; // 決算期間数、デフォルト 10、範囲 [1, 50]
}
message Request
{
required C2S c2s = 1;
}
2
3
4
5
6
7
8
9
10
- 銘柄構造については Security 参照
- 戻り値
// 1取引日分の株価データ
message PricePerformanceRow
{
optional int64 tradingDay = 1; // 取引日タイムスタンプ(秒)
optional string tradingDayStr = 2; // 取引日文字列、形式 YYYY-MM-DD、対応市場タイムゾーン
optional double closePrice = 3; // 終値
optional double openPrice = 4; // 始値
optional double highestPrice = 5; // 高値
optional double lowestPrice = 6; // 安値
optional double lastClosePrice = 7; // 前日終値
optional double optionIV = 8; // インプライドボラティリティ(パーセント前の値、12.34は12.34%)
optional double optionHV = 9; // ヒストリカルボラティリティ(パーセント前の値、12.34は12.34%)
}
// 単期決算期間の相場データ、決算メタ情報と決算日前後の取引日価格系列を含む
message ReportCycleQuote
{
optional int32 fiscalYear = 1; // 会計年度(例:2024)
optional int32 financialType = 2; // 決算種別、Qot_Common.F10Type 定義参照
optional string periodText = 3; // 決算期間(例:"2024/Q3"、"2024/FY")
optional int64 pubTradingDay = 4; // 決算発表日の取引日タイムスタンプ(秒)
optional string pubTradingDayStr = 5; // 決算発表取引日文字列、形式 YYYY-MM-DD、対応市場タイムゾーン
optional Qot_Common.EarningsPubTimeType pubType = 6; // 決算発表時間種別、Qot_Common.EarningsPubTimeType 定義参照
optional int32 priceInfoIndex = 7; // itemList 内の決算発表当日のインデックス(0-based);-1 はデータなし
repeated PricePerformanceRow itemList = 8; // 決算日前後の取引日相場リスト(時系列昇順)
}
message S2C
{
repeated ReportCycleQuote detailList = 1; // 各決算期間の詳細相場データリスト、決算発表日降順
}
message Response
{
required int32 retType = 1 [default = -400]; // 戻り値の種別、Common.RetType 参照、0=成功、負数=失敗
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
- API呼び出し結果の構造については RetType 参照
- 決算種別については F10Type 参照
- 決算発表時間種別については EarningsPubTimeType 参照
- 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=%b desc=%s connID=%d\n", errCode, desc, client.getConnectID());
if (errCode != 0)
return;
QotCommon.Security sec = QotCommon.Security.newBuilder()
.setMarket(QotCommon.QotMarket.QotMarket_HK_Security_VALUE)
.setCode("00700")
.build();
QotGetFinancialsEarningsPriceMove.C2S c2s = QotGetFinancialsEarningsPriceMove.C2S.newBuilder()
.setSecurity(sec)
.build();
QotGetFinancialsEarningsPriceMove.Request req = QotGetFinancialsEarningsPriceMove.Request.newBuilder().setC2S(c2s).build();
int seqNo = qot.getFinancialsEarningsPriceMove(req);
System.out.printf("Send QotGetFinancialsEarningsPriceMove: %d\n", seqNo);
}
@Override
public void onDisconnect(FTAPI_Conn client, long errCode) {
System.out.printf("Qot onDisConnect: %d\n", errCode);
}
@Override
public void onReply_GetFinancialsEarningsPriceMove(FTAPI_Conn client, int nSerialNo, QotGetFinancialsEarningsPriceMove.Response rsp) {
if (rsp.getRetType() != 0) {
System.out.printf("QotGetFinancialsEarningsPriceMove failed: %s\n", rsp.getRetMsg());
}
else {
try {
String json = JsonFormat.printer().print(rsp);
System.out.printf("Receive QotGetFinancialsEarningsPriceMove: %s\n", 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
- Output
Qot onInitConnect: ret=0 desc= connID=7459212546376114061
Send Qot_GetFinancialsEarningsPriceMove: 2
Receive Qot_GetFinancialsEarningsPriceMove: retType: 0
retMsg: ""
errCode: 0
s2c {
detailList {
fiscalYear: 2026
financialType: 1
periodText: "2026/Q1"
pubTradingDay: 1778601600
pubTradingDayStr: "2026-05-13"
pubType: EarningsPubTimeType_Unknown
priceInfoIndex: 5
itemList {
tradingDay: 1777996800
tradingDayStr: "2026-05-06"
closePrice: 463.0
openPrice: 470.6
highestPrice: 473.4
lowestPrice: 460.2
lastClosePrice: 472.2
optionIV: 31.829
optionHV: 32.22
}
itemList {
//...
}
}
detailList {
//...
}
}
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
Futu::u32_t GetFinancialsEarningsPriceMove(const Qot_GetFinancialsEarningsPriceMove::Request &stReq);
virtual void OnReply_GetFinancialsEarningsPriceMove(Futu::u32_t nSerialNo, const Qot_GetFinancialsEarningsPriceMove::Response &stRsp) = 0;
説明
決算日前後の価格変動を取得
パラメータ
message C2S
{
required Qot_Common.Security security = 1; // 銘柄
optional int32 periodCount = 2; // 決算期間数、デフォルト 10、範囲 [1, 50]
}
message Request
{
required C2S c2s = 1;
}
2
3
4
5
6
7
8
9
10
- 銘柄構造については Security 参照
- 戻り値
// 1取引日分の株価データ
message PricePerformanceRow
{
optional int64 tradingDay = 1; // 取引日タイムスタンプ(秒)
optional string tradingDayStr = 2; // 取引日文字列、形式 YYYY-MM-DD、対応市場タイムゾーン
optional double closePrice = 3; // 終値
optional double openPrice = 4; // 始値
optional double highestPrice = 5; // 高値
optional double lowestPrice = 6; // 安値
optional double lastClosePrice = 7; // 前日終値
optional double optionIV = 8; // インプライドボラティリティ(パーセント前の値、12.34は12.34%)
optional double optionHV = 9; // ヒストリカルボラティリティ(パーセント前の値、12.34は12.34%)
}
// 単期決算期間の相場データ、決算メタ情報と決算日前後の取引日価格系列を含む
message ReportCycleQuote
{
optional int32 fiscalYear = 1; // 会計年度(例:2024)
optional int32 financialType = 2; // 決算種別、Qot_Common.F10Type 定義参照
optional string periodText = 3; // 決算期間(例:"2024/Q3"、"2024/FY")
optional int64 pubTradingDay = 4; // 決算発表日の取引日タイムスタンプ(秒)
optional string pubTradingDayStr = 5; // 決算発表取引日文字列、形式 YYYY-MM-DD、対応市場タイムゾーン
optional Qot_Common.EarningsPubTimeType pubType = 6; // 決算発表時間種別、Qot_Common.EarningsPubTimeType 定義参照
optional int32 priceInfoIndex = 7; // itemList 内の決算発表当日のインデックス(0-based);-1 はデータなし
repeated PricePerformanceRow itemList = 8; // 決算日前後の取引日相場リスト(時系列昇順)
}
message S2C
{
repeated ReportCycleQuote detailList = 1; // 各決算期間の詳細相場データリスト、決算発表日降順
}
message Response
{
required int32 retType = 1 [default = -400]; // 戻り値の種別、Common.RetType 参照、0=成功、負数=失敗
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
- API呼び出し結果の構造については RetType 参照
- 決算種別については F10Type 参照
- 決算発表時間種別については EarningsPubTimeType 参照
- 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;
// construct request message
Qot_GetFinancialsEarningsPriceMove::Request req;
Qot_GetFinancialsEarningsPriceMove::C2S *c2s = req.mutable_c2s();
Qot_Common::Security *sec = c2s->mutable_security();
sec->set_code("00700");
sec->set_market(Qot_Common::QotMarket::QotMarket_HK_Security);
m_pQotApi->GetFinancialsEarningsPriceMove(req);
cout << "GetFinancialsEarningsPriceMove" << endl;
}
virtual void OnReply_GetFinancialsEarningsPriceMove(Futu::u32_t nSerialNo, const Qot_GetFinancialsEarningsPriceMove::Response &stRsp){
cout << "OnReply_GetFinancialsEarningsPriceMove:" << endl;
// print response
// ProtoBufToBodyData and UTF8ToLocal refer to tool.h in Samples
string resp_str;
ProtoBufToBodyData(stRsp, resp_str);
cout << UTF8ToLocal(resp_str) << endl;
}
protected:
FTAPI_Qot *m_pQotApi;
};
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
- Output
onInitConnect: ret=0 desc=Succeed!
Send GetFinancialsEarningsPriceMove seqNo=3
retType: 0
retMsg: ""
errCode: 0
s2c {
detailList {
fiscalYear: 2026
financialType: 1
periodText: "2026/Q1"
pubTradingDay: 1778601600
pubTradingDayStr: "2026-05-13"
pubType: EarningsPubTimeType_Unknown
priceInfoIndex: 5
itemList {
tradingDay: 1777996800
tradingDayStr: "2026-05-06"
closePrice: 463
openPrice: 470.6
highestPrice: 473.4
lowestPrice: 460.2
lastClosePrice: 472.2
optionIV: 31.829
optionHV: 32.22
}
itemList {
//...
}
}
detailList {
//...
}
}
detailList count: 10
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
GetFinancialsEarningsPriceMove(req);
説明
決算日前後の価格変動を取得
パラメータ
message C2S
{
required Qot_Common.Security security = 1; // 銘柄
optional int32 periodCount = 2; // 決算期間数、デフォルト 10、範囲 [1, 50]
}
message Request
{
required C2S c2s = 1;
}
2
3
4
5
6
7
8
9
10
- 銘柄構造については Security 参照
- 戻り値
// 1取引日分の株価データ
message PricePerformanceRow
{
optional int64 tradingDay = 1; // 取引日タイムスタンプ(秒)
optional string tradingDayStr = 2; // 取引日文字列、形式 YYYY-MM-DD、対応市場タイムゾーン
optional double closePrice = 3; // 終値
optional double openPrice = 4; // 始値
optional double highestPrice = 5; // 高値
optional double lowestPrice = 6; // 安値
optional double lastClosePrice = 7; // 前日終値
optional double optionIV = 8; // インプライドボラティリティ(パーセント前の値、12.34は12.34%)
optional double optionHV = 9; // ヒストリカルボラティリティ(パーセント前の値、12.34は12.34%)
}
// 単期決算期間の相場データ、決算メタ情報と決算日前後の取引日価格系列を含む
message ReportCycleQuote
{
optional int32 fiscalYear = 1; // 会計年度(例:2024)
optional int32 financialType = 2; // 決算種別、Qot_Common.F10Type 定義参照
optional string periodText = 3; // 決算期間(例:"2024/Q3"、"2024/FY")
optional int64 pubTradingDay = 4; // 決算発表日の取引日タイムスタンプ(秒)
optional string pubTradingDayStr = 5; // 決算発表取引日文字列、形式 YYYY-MM-DD、対応市場タイムゾーン
optional Qot_Common.EarningsPubTimeType pubType = 6; // 決算発表時間種別、Qot_Common.EarningsPubTimeType 定義参照
optional int32 priceInfoIndex = 7; // itemList 内の決算発表当日のインデックス(0-based);-1 はデータなし
repeated PricePerformanceRow itemList = 8; // 決算日前後の取引日相場リスト(時系列昇順)
}
message S2C
{
repeated ReportCycleQuote detailList = 1; // 各決算期間の詳細相場データリスト、決算発表日降順
}
message Response
{
required int32 retType = 1 [default = -400]; // 戻り値の種別、Common.RetType 参照、0=成功、負数=失敗
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
- API呼び出し結果の構造については RetType 参照
- 決算種別については F10Type 参照
- 決算発表時間種別については EarningsPubTimeType 参照
- Example
import ftWebsocket from "futu-api";
import { Common, Qot_Common } from "futu-api/proto";
import beautify from "js-beautify";
function QotGetFinancialsEarningsPriceMove(){
const { RetType } = Common
const { QotMarket } = Qot_Common
let [addr, port, enable_ssl, key] = ["127.0.0.1", 33333, false, '7522027ccf5a06b1'];
let websocket = new ftWebsocket();
websocket.onlogin = (ret, msg)=>{
if (ret) {
const req = {
c2s: {
security: {
market: QotMarket.QotMarket_HK_Security,
code: "00700",
},
},
};
websocket.GetFinancialsEarningsPriceMove(req)
.then((res) => {
let { errCode, retMsg, retType,s2c } = res
console.log("GetFinancialsEarningsPriceMove: 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("error", msg);
}
};
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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
- Output
GetFinancialsEarningsPriceMove: errCode 0, retMsg , retType 0
{
"detailList": [{
"fiscalYear": 2026,
"financialType": 1,
"periodText": "2026/Q1",
"pubTradingDay": "1778601600",
"pubTradingDayStr": "2026-05-13",
"pubType": "EarningsPubTimeType_Unknown",
"priceInfoIndex": 5,
"itemList": [{
"tradingDay": "1777996800",
"tradingDayStr": "2026-05-06",
"closePrice": 463,
"openPrice": 470.6,
"highestPrice": 473.4,
"lowestPrice": 460.2,
"lastClosePrice": 472.2,
"optionIV": 31.829,
"optionHV": 32.22
//...
}]
//...
}]
}
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
制限事項
- 30秒間に最大30リクエスト。
- 香港株・米国株(普通株)のみ対応。
- Python
- Proto
- C#
- Java
- C++
- JavaScript
get_financials_earnings_price_move(code, period_count=None)
説明
決算日前後の価格変動を取得
パラメータ
パラメータ 型 説明 code str 銘柄コード period_count int 決算期間数 デフォルト 10、範囲 [1, 50]戻り値
パラメータ 型 説明 ret RET_CODE API呼び出し結果 data pd.DataFrame ret == RET_OK の場合、取引日ごとに展開した明細データを返します str ret != RET_OK の場合、エラーの説明を返します 各行に決算メタ情報と当日の相場データが含まれます:
フィールド 型 説明 fiscal_year int 会計年度 例:2024financial_type F10Type 決算種別 0=不明、1=Q1、2=Q2、3=Q3、4=Q4、7=通年、9=四半期などperiod_text str 決算期間 例:"2024/Q3"、"2024/FY"pub_trading_day_str str 決算発表日対応取引日 形式:yyyy-MM-dd;対応市場タイムゾーンpub_type EarningsPubTimeType 決算発表時間種別 0=不明、1=寄り前、2=引け後、3=立会中price_info_index int 決算発表日のitemList内インデックス 0始まり;-1はデータなしday_offset int 決算発表日からのオフセット日数 負=発表前、0=発表当日、正=発表後trading_day_str str 取引日 形式:yyyy-MM-dd;対応市場タイムゾーンclose_price float 終値 open_price float 始値 highest_price float 高値 lowest_price float 安値 last_close_price float 前日終値 option_iv float インプライドボラティリティ パーセント前の値、例:12.34は12.34%を意味するoption_hv float ヒストリカルボラティリティ パーセント前の値、例:12.34は12.34%を意味する
Example
from moomoo import *
quote_ctx = OpenQuoteContext(host='127.0.0.1', port=11111)
ret, data = quote_ctx.get_financials_earnings_price_move("HK.00700", period_count=2)
if ret == RET_OK:
print(data)
print(data['period_text'][0])
else:
print('error:', data)
quote_ctx.close()
2
3
4
5
6
7
8
9
10
- Output
fiscal_year financial_type ... option_iv option_hv
0 2026 1 ... 31.829 32.220
1 2026 1 ... 33.173 33.720
2 2026 1 ... 32.963 30.355
3 2026 1 ... NaN NaN
4 2025 4 ... 35.804 37.891
5 2025 4 ... 35.845 37.478
6 2025 4 ... 38.504 37.580
7 2025 4 ... 35.518 38.175
8 2025 4 ... 34.739 37.446
9 2025 4 ... 34.248 37.558
10 2025 4 ... 31.682 44.855
11 2025 4 ... 30.907 43.536
12 2025 4 ... 34.614 43.426
13 2025 4 ... 33.617 44.177
14 2025 4 ... 34.503 42.810
[15 rows x 17 columns]
2026/Q1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
# Qot_GetFinancialsEarningsPriceMove.proto
説明
決算日前後の価格変動を取得
パラメータ
message C2S
{
required Qot_Common.Security security = 1; // 銘柄
optional int32 periodCount = 2; // 決算期間数、デフォルト 10、範囲 [1, 50]
}
message Request
{
required C2S c2s = 1;
}
2
3
4
5
6
7
8
9
10
- 銘柄構造については Security 参照
- 戻り値
// 1取引日分の株価データ
message PricePerformanceRow
{
optional int64 tradingDay = 1; // 取引日タイムスタンプ(秒)
optional string tradingDayStr = 2; // 取引日文字列、形式 YYYY-MM-DD、対応市場タイムゾーン
optional double closePrice = 3; // 終値
optional double openPrice = 4; // 始値
optional double highestPrice = 5; // 高値
optional double lowestPrice = 6; // 安値
optional double lastClosePrice = 7; // 前日終値
optional double optionIV = 8; // インプライドボラティリティ(パーセント前の値、12.34は12.34%)
optional double optionHV = 9; // ヒストリカルボラティリティ(パーセント前の値、12.34は12.34%)
}
// 単期決算期間の相場データ、決算メタ情報と決算日前後の取引日価格系列を含む
message ReportCycleQuote
{
optional int32 fiscalYear = 1; // 会計年度(例:2024)
optional int32 financialType = 2; // 決算種別、Qot_Common.F10Type 定義参照
optional string periodText = 3; // 決算期間(例:"2024/Q3"、"2024/FY")
optional int64 pubTradingDay = 4; // 決算発表日の取引日タイムスタンプ(秒)
optional string pubTradingDayStr = 5; // 決算発表取引日文字列、形式 YYYY-MM-DD、対応市場タイムゾーン
optional Qot_Common.EarningsPubTimeType pubType = 6; // 決算発表時間種別、Qot_Common.EarningsPubTimeType 定義参照
optional int32 priceInfoIndex = 7; // itemList 内の決算発表当日のインデックス(0-based);-1 はデータなし
repeated PricePerformanceRow itemList = 8; // 決算日前後の取引日相場リスト(時系列昇順)
}
message S2C
{
repeated ReportCycleQuote detailList = 1; // 各決算期間の詳細相場データリスト、決算発表日降順
}
message Response
{
required int32 retType = 1 [default = -400]; // 戻り値の種別、Common.RetType 参照、0=成功、負数=失敗
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
- API呼び出し結果の構造については RetType 参照
- 決算種別については F10Type 参照
- 決算発表時間種別については EarningsPubTimeType 参照
プロトコル ID
3225
uint GetFinancialsEarningsPriceMove(QotGetFinancialsEarningsPriceMove.Request req);
virtual void OnReply_GetFinancialsEarningsPriceMove(MMAPI_Conn client, uint nSerialNo, QotGetFinancialsEarningsPriceMove.Response rsp);
説明
決算日前後の価格変動を取得
パラメータ
message C2S
{
required Qot_Common.Security security = 1; // 銘柄
optional int32 periodCount = 2; // 決算期間数、デフォルト 10、範囲 [1, 50]
}
message Request
{
required C2S c2s = 1;
}
2
3
4
5
6
7
8
9
10
- 銘柄構造については Security 参照
- 戻り値
// 1取引日分の株価データ
message PricePerformanceRow
{
optional int64 tradingDay = 1; // 取引日タイムスタンプ(秒)
optional string tradingDayStr = 2; // 取引日文字列、形式 YYYY-MM-DD、対応市場タイムゾーン
optional double closePrice = 3; // 終値
optional double openPrice = 4; // 始値
optional double highestPrice = 5; // 高値
optional double lowestPrice = 6; // 安値
optional double lastClosePrice = 7; // 前日終値
optional double optionIV = 8; // インプライドボラティリティ(パーセント前の値、12.34は12.34%)
optional double optionHV = 9; // ヒストリカルボラティリティ(パーセント前の値、12.34は12.34%)
}
// 単期決算期間の相場データ、決算メタ情報と決算日前後の取引日価格系列を含む
message ReportCycleQuote
{
optional int32 fiscalYear = 1; // 会計年度(例:2024)
optional int32 financialType = 2; // 決算種別、Qot_Common.F10Type 定義参照
optional string periodText = 3; // 決算期間(例:"2024/Q3"、"2024/FY")
optional int64 pubTradingDay = 4; // 決算発表日の取引日タイムスタンプ(秒)
optional string pubTradingDayStr = 5; // 決算発表取引日文字列、形式 YYYY-MM-DD、対応市場タイムゾーン
optional Qot_Common.EarningsPubTimeType pubType = 6; // 決算発表時間種別、Qot_Common.EarningsPubTimeType 定義参照
optional int32 priceInfoIndex = 7; // itemList 内の決算発表当日のインデックス(0-based);-1 はデータなし
repeated PricePerformanceRow itemList = 8; // 決算日前後の取引日相場リスト(時系列昇順)
}
message S2C
{
repeated ReportCycleQuote detailList = 1; // 各決算期間の詳細相場データリスト、決算発表日降順
}
message Response
{
required int32 retType = 1 [default = -400]; // 戻り値の種別、Common.RetType 参照、0=成功、負数=失敗
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
- API呼び出し結果の構造については RetType 参照
- 決算種別については F10Type 参照
- 決算発表時間種別については EarningsPubTimeType 参照
- 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}\n", errCode, desc, client.GetConnectID());
if (errCode != 0)
return;
QotCommon.Security sec = QotCommon.Security.CreateBuilder()
.SetMarket((int)QotCommon.QotMarket.QotMarket_HK_Security)
.SetCode("00700")
.Build();
QotGetFinancialsEarningsPriceMove.C2S c2s = QotGetFinancialsEarningsPriceMove.C2S.CreateBuilder()
.SetSecurity(sec)
.Build();
QotGetFinancialsEarningsPriceMove.Request req = QotGetFinancialsEarningsPriceMove.Request.CreateBuilder().SetC2S(c2s).Build();
uint seqNo = qot.GetFinancialsEarningsPriceMove(req);
Console.Write("Send QotGetFinancialsEarningsPriceMove: {0}\n", seqNo);
}
public void OnDisconnect(MMAPI_Conn client, long errCode)
{
Console.Write("Qot onDisConnect: {0}\n", errCode);
}
public void OnReply_GetFinancialsEarningsPriceMove(MMAPI_Conn client, uint nSerialNo, QotGetFinancialsEarningsPriceMove.Response rsp)
{
Console.Write("Reply: QotGetFinancialsEarningsPriceMove: {0} {1}\n", nSerialNo, rsp.ToString());
}
public static void Main(String[] args)
{
MMAPI.Init();
Program qot = new Program();
qot.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
55
56
- Output
Qot onInitConnect: ret=0 desc= connID=7459212541089800422
Send QotGetFinancialsEarningsPriceMove: 3
Reply: QotGetFinancialsEarningsPriceMove: 3 retType: 0
retMsg: ""
errCode: 0
s2c {
detailList {
fiscalYear: 2026
financialType: 1
periodText: "2026/Q1"
pubTradingDay: 1778601600
pubTradingDayStr: "2026-05-13"
pubType: EarningsPubTimeType_Unknown
priceInfoIndex: 5
itemList {
tradingDay: 1777996800
tradingDayStr: "2026-05-06"
closePrice: 463
openPrice: 470.6
highestPrice: 473.4
lowestPrice: 460.2
lastClosePrice: 472.2
optionIV: 31.829
optionHV: 32.22
}
itemList {
//...
}
}
detailList {
//...
}
}
detailList count: 10
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
int getFinancialsEarningsPriceMove(QotGetFinancialsEarningsPriceMove.Request req);
void onReply_GetFinancialsEarningsPriceMove(MMAPI_Conn client, int nSerialNo, QotGetFinancialsEarningsPriceMove.Response rsp);
説明
決算日前後の価格変動を取得
パラメータ
message C2S
{
required Qot_Common.Security security = 1; // 銘柄
optional int32 periodCount = 2; // 決算期間数、デフォルト 10、範囲 [1, 50]
}
message Request
{
required C2S c2s = 1;
}
2
3
4
5
6
7
8
9
10
- 銘柄構造については Security 参照
- 戻り値
// 1取引日分の株価データ
message PricePerformanceRow
{
optional int64 tradingDay = 1; // 取引日タイムスタンプ(秒)
optional string tradingDayStr = 2; // 取引日文字列、形式 YYYY-MM-DD、対応市場タイムゾーン
optional double closePrice = 3; // 終値
optional double openPrice = 4; // 始値
optional double highestPrice = 5; // 高値
optional double lowestPrice = 6; // 安値
optional double lastClosePrice = 7; // 前日終値
optional double optionIV = 8; // インプライドボラティリティ(パーセント前の値、12.34は12.34%)
optional double optionHV = 9; // ヒストリカルボラティリティ(パーセント前の値、12.34は12.34%)
}
// 単期決算期間の相場データ、決算メタ情報と決算日前後の取引日価格系列を含む
message ReportCycleQuote
{
optional int32 fiscalYear = 1; // 会計年度(例:2024)
optional int32 financialType = 2; // 決算種別、Qot_Common.F10Type 定義参照
optional string periodText = 3; // 決算期間(例:"2024/Q3"、"2024/FY")
optional int64 pubTradingDay = 4; // 決算発表日の取引日タイムスタンプ(秒)
optional string pubTradingDayStr = 5; // 決算発表取引日文字列、形式 YYYY-MM-DD、対応市場タイムゾーン
optional Qot_Common.EarningsPubTimeType pubType = 6; // 決算発表時間種別、Qot_Common.EarningsPubTimeType 定義参照
optional int32 priceInfoIndex = 7; // itemList 内の決算発表当日のインデックス(0-based);-1 はデータなし
repeated PricePerformanceRow itemList = 8; // 決算日前後の取引日相場リスト(時系列昇順)
}
message S2C
{
repeated ReportCycleQuote detailList = 1; // 各決算期間の詳細相場データリスト、決算発表日降順
}
message Response
{
required int32 retType = 1 [default = -400]; // 戻り値の種別、Common.RetType 参照、0=成功、負数=失敗
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
- API呼び出し結果の構造については RetType 参照
- 決算種別については F10Type 参照
- 決算発表時間種別については EarningsPubTimeType 参照
- 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=%b desc=%s connID=%d\n", errCode, desc, client.getConnectID());
if (errCode != 0)
return;
QotCommon.Security sec = QotCommon.Security.newBuilder()
.setMarket(QotCommon.QotMarket.QotMarket_HK_Security_VALUE)
.setCode("00700")
.build();
QotGetFinancialsEarningsPriceMove.C2S c2s = QotGetFinancialsEarningsPriceMove.C2S.newBuilder()
.setSecurity(sec)
.build();
QotGetFinancialsEarningsPriceMove.Request req = QotGetFinancialsEarningsPriceMove.Request.newBuilder().setC2S(c2s).build();
int seqNo = qot.getFinancialsEarningsPriceMove(req);
System.out.printf("Send QotGetFinancialsEarningsPriceMove: %d\n", seqNo);
}
@Override
public void onDisconnect(MMAPI_Conn client, long errCode) {
System.out.printf("Qot onDisConnect: %d\n", errCode);
}
@Override
public void onReply_GetFinancialsEarningsPriceMove(MMAPI_Conn client, int nSerialNo, QotGetFinancialsEarningsPriceMove.Response rsp) {
if (rsp.getRetType() != 0) {
System.out.printf("QotGetFinancialsEarningsPriceMove failed: %s\n", rsp.getRetMsg());
}
else {
try {
String json = JsonFormat.printer().print(rsp);
System.out.printf("Receive QotGetFinancialsEarningsPriceMove: %s\n", 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
- Output
Qot onInitConnect: ret=0 desc= connID=7459212546376114061
Send Qot_GetFinancialsEarningsPriceMove: 2
Receive Qot_GetFinancialsEarningsPriceMove: retType: 0
retMsg: ""
errCode: 0
s2c {
detailList {
fiscalYear: 2026
financialType: 1
periodText: "2026/Q1"
pubTradingDay: 1778601600
pubTradingDayStr: "2026-05-13"
pubType: EarningsPubTimeType_Unknown
priceInfoIndex: 5
itemList {
tradingDay: 1777996800
tradingDayStr: "2026-05-06"
closePrice: 463.0
openPrice: 470.6
highestPrice: 473.4
lowestPrice: 460.2
lastClosePrice: 472.2
optionIV: 31.829
optionHV: 32.22
}
itemList {
//...
}
}
detailList {
//...
}
}
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
moomoo::u32_t GetFinancialsEarningsPriceMove(const Qot_GetFinancialsEarningsPriceMove::Request &stReq);
virtual void OnReply_GetFinancialsEarningsPriceMove(moomoo::u32_t nSerialNo, const Qot_GetFinancialsEarningsPriceMove::Response &stRsp) = 0;
説明
決算日前後の価格変動を取得
パラメータ
message C2S
{
required Qot_Common.Security security = 1; // 銘柄
optional int32 periodCount = 2; // 決算期間数、デフォルト 10、範囲 [1, 50]
}
message Request
{
required C2S c2s = 1;
}
2
3
4
5
6
7
8
9
10
- 銘柄構造については Security 参照
- 戻り値
// 1取引日分の株価データ
message PricePerformanceRow
{
optional int64 tradingDay = 1; // 取引日タイムスタンプ(秒)
optional string tradingDayStr = 2; // 取引日文字列、形式 YYYY-MM-DD、対応市場タイムゾーン
optional double closePrice = 3; // 終値
optional double openPrice = 4; // 始値
optional double highestPrice = 5; // 高値
optional double lowestPrice = 6; // 安値
optional double lastClosePrice = 7; // 前日終値
optional double optionIV = 8; // インプライドボラティリティ(パーセント前の値、12.34は12.34%)
optional double optionHV = 9; // ヒストリカルボラティリティ(パーセント前の値、12.34は12.34%)
}
// 単期決算期間の相場データ、決算メタ情報と決算日前後の取引日価格系列を含む
message ReportCycleQuote
{
optional int32 fiscalYear = 1; // 会計年度(例:2024)
optional int32 financialType = 2; // 決算種別、Qot_Common.F10Type 定義参照
optional string periodText = 3; // 決算期間(例:"2024/Q3"、"2024/FY")
optional int64 pubTradingDay = 4; // 決算発表日の取引日タイムスタンプ(秒)
optional string pubTradingDayStr = 5; // 決算発表取引日文字列、形式 YYYY-MM-DD、対応市場タイムゾーン
optional Qot_Common.EarningsPubTimeType pubType = 6; // 決算発表時間種別、Qot_Common.EarningsPubTimeType 定義参照
optional int32 priceInfoIndex = 7; // itemList 内の決算発表当日のインデックス(0-based);-1 はデータなし
repeated PricePerformanceRow itemList = 8; // 決算日前後の取引日相場リスト(時系列昇順)
}
message S2C
{
repeated ReportCycleQuote detailList = 1; // 各決算期間の詳細相場データリスト、決算発表日降順
}
message Response
{
required int32 retType = 1 [default = -400]; // 戻り値の種別、Common.RetType 参照、0=成功、負数=失敗
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
- API呼び出し結果の構造については RetType 参照
- 決算種別については F10Type 参照
- 決算発表時間種別については EarningsPubTimeType 参照
- 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;
// construct request message
Qot_GetFinancialsEarningsPriceMove::Request req;
Qot_GetFinancialsEarningsPriceMove::C2S *c2s = req.mutable_c2s();
Qot_Common::Security *sec = c2s->mutable_security();
sec->set_code("00700");
sec->set_market(Qot_Common::QotMarket::QotMarket_HK_Security);
m_pQotApi->GetFinancialsEarningsPriceMove(req);
cout << "GetFinancialsEarningsPriceMove" << endl;
}
virtual void OnReply_GetFinancialsEarningsPriceMove(moomoo::u32_t nSerialNo, const Qot_GetFinancialsEarningsPriceMove::Response &stRsp){
cout << "OnReply_GetFinancialsEarningsPriceMove:" << endl;
// print response
// ProtoBufToBodyData and UTF8ToLocal refer to tool.h in Samples
string resp_str;
ProtoBufToBodyData(stRsp, resp_str);
cout << UTF8ToLocal(resp_str) << endl;
}
protected:
MMAPI_Qot *m_pQotApi;
};
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
- Output
onInitConnect: ret=0 desc=Succeed!
Send GetFinancialsEarningsPriceMove seqNo=3
retType: 0
retMsg: ""
errCode: 0
s2c {
detailList {
fiscalYear: 2026
financialType: 1
periodText: "2026/Q1"
pubTradingDay: 1778601600
pubTradingDayStr: "2026-05-13"
pubType: EarningsPubTimeType_Unknown
priceInfoIndex: 5
itemList {
tradingDay: 1777996800
tradingDayStr: "2026-05-06"
closePrice: 463
openPrice: 470.6
highestPrice: 473.4
lowestPrice: 460.2
lastClosePrice: 472.2
optionIV: 31.829
optionHV: 32.22
}
itemList {
//...
}
}
detailList {
//...
}
}
detailList count: 10
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
GetFinancialsEarningsPriceMove(req);
説明
決算日前後の価格変動を取得
パラメータ
message C2S
{
required Qot_Common.Security security = 1; // 銘柄
optional int32 periodCount = 2; // 決算期間数、デフォルト 10、範囲 [1, 50]
}
message Request
{
required C2S c2s = 1;
}
2
3
4
5
6
7
8
9
10
- 銘柄構造については Security 参照
- 戻り値
// 1取引日分の株価データ
message PricePerformanceRow
{
optional int64 tradingDay = 1; // 取引日タイムスタンプ(秒)
optional string tradingDayStr = 2; // 取引日文字列、形式 YYYY-MM-DD、対応市場タイムゾーン
optional double closePrice = 3; // 終値
optional double openPrice = 4; // 始値
optional double highestPrice = 5; // 高値
optional double lowestPrice = 6; // 安値
optional double lastClosePrice = 7; // 前日終値
optional double optionIV = 8; // インプライドボラティリティ(パーセント前の値、12.34は12.34%)
optional double optionHV = 9; // ヒストリカルボラティリティ(パーセント前の値、12.34は12.34%)
}
// 単期決算期間の相場データ、決算メタ情報と決算日前後の取引日価格系列を含む
message ReportCycleQuote
{
optional int32 fiscalYear = 1; // 会計年度(例:2024)
optional int32 financialType = 2; // 決算種別、Qot_Common.F10Type 定義参照
optional string periodText = 3; // 決算期間(例:"2024/Q3"、"2024/FY")
optional int64 pubTradingDay = 4; // 決算発表日の取引日タイムスタンプ(秒)
optional string pubTradingDayStr = 5; // 決算発表取引日文字列、形式 YYYY-MM-DD、対応市場タイムゾーン
optional Qot_Common.EarningsPubTimeType pubType = 6; // 決算発表時間種別、Qot_Common.EarningsPubTimeType 定義参照
optional int32 priceInfoIndex = 7; // itemList 内の決算発表当日のインデックス(0-based);-1 はデータなし
repeated PricePerformanceRow itemList = 8; // 決算日前後の取引日相場リスト(時系列昇順)
}
message S2C
{
repeated ReportCycleQuote detailList = 1; // 各決算期間の詳細相場データリスト、決算発表日降順
}
message Response
{
required int32 retType = 1 [default = -400]; // 戻り値の種別、Common.RetType 参照、0=成功、負数=失敗
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
- API呼び出し結果の構造については RetType 参照
- 決算種別については F10Type 参照
- 決算発表時間種別については EarningsPubTimeType 参照
- Example
import mmWebsocket from "moomoo-api";
import { Common, Qot_Common } from "moomoo-api/proto";
import beautify from "js-beautify";
function QotGetFinancialsEarningsPriceMove(){
const { RetType } = Common
const { QotMarket } = Qot_Common
let [addr, port, enable_ssl, key] = ["127.0.0.1", 33333, false, '7522027ccf5a06b1'];
let websocket = new mmWebsocket();
websocket.onlogin = (ret, msg)=>{
if (ret) {
const req = {
c2s: {
security: {
market: QotMarket.QotMarket_HK_Security,
code: "00700",
},
},
};
websocket.GetFinancialsEarningsPriceMove(req)
.then((res) => {
let { errCode, retMsg, retType,s2c } = res
console.log("GetFinancialsEarningsPriceMove: 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("error", msg);
}
};
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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
- Output
GetFinancialsEarningsPriceMove: errCode 0, retMsg , retType 0
{
"detailList": [{
"fiscalYear": 2026,
"financialType": 1,
"periodText": "2026/Q1",
"pubTradingDay": "1778601600",
"pubTradingDayStr": "2026-05-13",
"pubType": "EarningsPubTimeType_Unknown",
"priceInfoIndex": 5,
"itemList": [{
"tradingDay": "1777996800",
"tradingDayStr": "2026-05-06",
"closePrice": 463,
"openPrice": 470.6,
"highestPrice": 473.4,
"lowestPrice": 460.2,
"lastClosePrice": 472.2,
"optionIV": 31.829,
"optionHV": 32.22
//...
}]
//...
}]
}
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
制限事項
- 30秒間に最大30リクエスト。
- 香港株・米国株(普通株)のみ対応。
← 取得復権因子 決算日前後の株価履歴を取得 →