Skip to content

Commit 849c90c

Browse files
committed
add 30 new quote APIs: financials, research, corporate actions, shareholders, insider trades, company profiles, short interest, option volatility, and screeners
Implement SDK wrappers (client, sdk_ctx, sdk) for all 30 new Futu quote APIs (protocol IDs 3225-3254), add adapt layer constants for new enum types (F10Type, ValuationType, FinancialStatementsType, SortType, etc.), and regenerate protobuf Go code from updated .proto definitions. 💘 Generated with Crush Assisted-by: Crush:mimo-v2.5-pro
1 parent 48ee0ed commit 849c90c

159 files changed

Lines changed: 29681 additions & 1141 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,3 +27,4 @@ go.work.sum
2727
.vscode
2828
.idea
2929
.DS_Store
30+
.crush

.proto/Common.proto

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,4 +85,6 @@ enum Session
8585
Session_ETH = 2;
8686
Session_ALL = 3;
8787
Session_OVERNIGHT = 4;
88-
}
88+
}
89+
90+
// SecurityFirm 已迁移到 Trd_Common.proto

.proto/GetUserInfo.proto

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ message S2C
6363
optional int32 shQotRight = 31; //上海市场行情权限, Qot_Common.QotRight
6464
optional int32 szQotRight = 32; //深圳市场行情权限, Qot_Common.QotRight
6565
optional int32 extra=33; // 透传信息
66+
optional int32 ccQotRight = 34; //加密货币市场行情权限, Qot_Common.QotRight
6667
}
6768

6869
message Request

.proto/Notify.proto

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@ message QotRight
7575
optional int32 usCBOEFutureQotRight = 20; //美股CBOE期货行情权限, Qot_Common.QotRight
7676
optional int32 shQotRight = 21; //上海A股行情权限, Qot_Common.QotRight
7777
optional int32 szQotRight = 22; //深圳A股行情权限, Qot_Common.QotRight
78+
optional int32 ccQotRight = 23; //加密货币市场行情权限, Qot_Common.QotRight
7879
}
7980

8081
message APILevel

.proto/Qot_Common.proto

Lines changed: 224 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ option go_package = "github.com/hyperjiang/futu/pb/qotcommon";
55

66
import "Common.proto";
77

8+
89
enum QotMarket
910
{
1011
QotMarket_Unknown = 0; //未知市场
@@ -19,21 +20,24 @@ enum QotMarket
1920
QotMarket_MY_Security = 61; //马来西亚市场
2021
QotMarket_CA_Security = 71; // 加拿大市场
2122
QotMarket_FX_Security = 81; // 外汇市场
23+
QotMarket_CC_Security = 91; // 加密货币市场
2224
}
2325

2426
enum SecurityType
2527
{
2628
SecurityType_Unknown = 0; //未知
27-
SecurityType_Bond = 1; //债券
29+
SecurityType_Bond = 1; //场内债券
2830
SecurityType_Bwrt = 2; //一揽子权证
2931
SecurityType_Eqty = 3; //正股
30-
SecurityType_Trust = 4; //信托,基金
32+
SecurityType_Trust = 4; //信托
3133
SecurityType_Warrant = 5; //窝轮
3234
SecurityType_Index = 6; //指数
3335
SecurityType_Plate = 7; //板块
3436
SecurityType_Drvt = 8; //期权
3537
SecurityType_PlateSet = 9; //板块集
3638
SecurityType_Future = 10; //期货
39+
SecurityType_Forex = 11; // 外汇
40+
SecurityType_Crypto = 12; // 数字货币
3741
}
3842

3943
enum PlateSetType
@@ -164,6 +168,10 @@ enum KLType
164168
KLType_60Min = 9; //60分K
165169
KLType_3Min = 10; //3分K
166170
KLType_Quarter = 11; //季K
171+
KLType_10Min = 12; //10分K
172+
KLType_120Min = 13; //120分K
173+
KLType_180Min = 14; //180分K
174+
KLType_240Min = 15; //240分K
167175
}
168176

169177
enum KLFields
@@ -202,6 +210,10 @@ enum SubType
202210
SubType_KL_Qurater = 15; //季K
203211
SubType_KL_Year = 16; //年K
204212
SubType_KL_3Min = 17; //3分K
213+
SubType_KL_10Min = 18; //10分K
214+
SubType_KL_120Min = 19; //120分K
215+
SubType_KL_180Min = 20; //180分K
216+
SubType_KL_240Min = 21; //240分K
205217
}
206218

207219
enum TickerDirection
@@ -298,7 +310,7 @@ enum PushDataType
298310
PushDataType_Cache = 3; //非实时非连接断开补充数据
299311
}
300312

301-
//窝轮排序
313+
//排序
302314
enum SortField
303315
{
304316
SortField_Unknow = 0;
@@ -358,6 +370,30 @@ enum SortField
358370
SortField_LastSettlePrice = 48; //昨结
359371
SortField_Position = 49; //持仓量
360372
SortField_PositionChange = 50; //日增仓
373+
374+
// 以下排序字段用于 Qot_GetValuationPlateStockList
375+
SortField_MarketCap = 51; // 市值
376+
SortField_Valuation = 52; // 估值
377+
SortField_ForwardValuation = 53; // 预测估值
378+
SortField_HistoricalPercentile = 54; // 历史分位
379+
380+
// 以下排序字段用于 Qot_GetShareholdersHolderDetail
381+
SortField_HolderQuantity = 61; // 持股股数
382+
// 以下排序字段用于 Qot_GetShareholdersHoldingChanges / Qot_GetShareholdersHolderDetail
383+
SortField_ShareChangeNum = 62; // 持股变动数
384+
// 以下排序字段用于 Qot_GetShareholdersHoldingChanges
385+
SortField_HoldingDate = 63; // 持股日期
386+
SortField_HolderPctChange = 64; // 变动比例
387+
SortField_HolderChangeAmount = 65; // 变动金额
388+
SortField_HolderPct = 66; // 持股比例
389+
}
390+
391+
// 排序方向
392+
enum SortType
393+
{
394+
SortType_Unknown = 0; // 未知
395+
SortType_Desc = 1; // 降序
396+
SortType_Asc = 2; // 升序
361397
}
362398

363399
//窝轮发行人
@@ -446,6 +482,7 @@ enum QotRight
446482
QotRight_Level2 = 3; //Level2
447483
QotRight_SF = 4; //SF高级行情
448484
QotRight_No = 5; //无权限
485+
QotRight_Level3 = 6; //Level3
449486
}
450487

451488
// 提醒类型
@@ -542,7 +579,9 @@ enum ExchType
542579
ExchType_CN_SZ = 15; //深交所
543580
ExchType_CN_STIB = 16; //科创板
544581
ExchType_SG_SGX = 17; //新交所
545-
ExchType_JP_OSE = 18; //大阪交易所
582+
ExchType_JP_OSE = 18; //大阪交易所
583+
ExchType_CC_CRYPTO = 19; //加密货币交易所
584+
ExchType_MY_BMS = 20; //马来西亚交易所
546585
}
547586

548587
// 周期类型
@@ -564,6 +603,181 @@ enum PriceReminderMarketStatus
564603
PriceReminderMarketStatus_USOverNight = 4; // 美股夜盘
565604
}
566605

606+
// 财报类型
607+
enum F10Type
608+
{
609+
F10Type_Unknown = 0;
610+
F10Type_Q1 = 1; // 单季报,Q1
611+
F10Type_Q2 = 2; // 单季报,Q2
612+
F10Type_Q3 = 3; // 单季报,Q3
613+
F10Type_Q4 = 4; // 单季报,Q4
614+
F10Type_Q6 = 5; // 累计季报,Q6(Q1+Q2)
615+
F10Type_Q9 = 6; // 累计季报,Q9(Q1+Q2+Q3)
616+
F10Type_Annual = 7; // 年报
617+
F10Type_Quarterly = 9; // 单季报组合(Q1, Q2, Q3, Q4)
618+
F10Type_QuarterlyAnnual = 10; // 单季报 + 年报
619+
F10Type_MulQuarterly = 11; // 累计季报(Q1, Q6, Q9, Annual)
620+
}
621+
622+
// 财报发布时间类型
623+
enum EarningsPubTimeType
624+
{
625+
EarningsPubTimeType_Unknown = 0; // 未知
626+
EarningsPubTimeType_PreMarket = 1; // 盘前发布
627+
EarningsPubTimeType_AfterMarket = 2; // 盘后发布
628+
EarningsPubTimeType_DuringMarket = 3; // 盘中发布
629+
}
630+
631+
// 估值类型
632+
enum ValuationType
633+
{
634+
ValuationType_Unknown = 0; // 未知
635+
ValuationType_PE = 1; // 市盈率
636+
ValuationType_PB = 2; // 市净率
637+
ValuationType_PS = 3; // 市销率
638+
}
639+
640+
// 财务报表类型
641+
enum FinancialStatementsType
642+
{
643+
FinancialStatementsType_Unknown = 0;
644+
FinancialStatementsType_Income = 1; // 利润表
645+
FinancialStatementsType_BalanceSheet = 2; // 资产负债表
646+
FinancialStatementsType_CashFlow = 3; // 现金流量表
647+
FinancialStatementsType_MainIndex = 4; // 关键指标
648+
}
649+
650+
// 主营构成维度类型
651+
enum RevenueBreakdownType
652+
{
653+
RevenueBreakdownType_Unknown = 0;
654+
RevenueBreakdownType_Product = 1; // 产品
655+
RevenueBreakdownType_Industry = 2; // 行业
656+
RevenueBreakdownType_Region = 4; // 地区
657+
RevenueBreakdownType_Business = 8; // 业务
658+
}
659+
660+
// 分析师评级
661+
enum ResearchRatingType
662+
{
663+
ResearchRatingType_Unknown = 0; // 未知
664+
ResearchRatingType_Sell = 1; // Sell(卖出)
665+
ResearchRatingType_Underperform = 2; // Underperform(跑输大盘)
666+
ResearchRatingType_Hold = 3; // Hold(持有)
667+
ResearchRatingType_Buy = 4; // Buy(买入)
668+
ResearchRatingType_StrongBuy = 5; // Strong Buy(强力推荐)
669+
}
670+
671+
// 研报评级汇总-评级维度
672+
enum ResearchRatingDimensionType
673+
{
674+
ResearchRatingDimensionType_Unknown = 0;
675+
ResearchRatingDimensionType_Institution = 1; // 机构维度(默认)
676+
ResearchRatingDimensionType_Analyst = 2; // 分析师维度
677+
}
678+
679+
// 晨星评级类型
680+
enum MorningstarRatingType
681+
{
682+
MorningstarRatingType_Unknown = 0; // 未知
683+
MorningstarRatingType_Quantitative = 1; // 定量评级(系统模型给出)
684+
MorningstarRatingType_Qualitative = 2; // 定性评级(分析师人工给出)
685+
}
686+
687+
// 估值历史区间类型
688+
enum ValuationIntervalType
689+
{
690+
ValuationIntervalType_Unknown = 0; // 未知
691+
ValuationIntervalType_Month3 = 1; // 3个月
692+
ValuationIntervalType_Month6 = 2; // 6个月
693+
ValuationIntervalType_Year1 = 3; // 1年
694+
ValuationIntervalType_Year3 = 4; // 3年
695+
ValuationIntervalType_Since2019 = 5; // 从2019年起
696+
ValuationIntervalType_Year5 = 6; // 5年
697+
ValuationIntervalType_Year10 = 7; // 10年
698+
ValuationIntervalType_Year2 = 8; // 2年
699+
ValuationIntervalType_Year20 = 9; // 20年
700+
ValuationIntervalType_Year30 = 10; // 30年
701+
}
702+
703+
// 持股变动筛选类型
704+
enum HoldingChangesFilterType
705+
{
706+
HoldingChangesFilterType_Unknown = 0; // 全部(默认)
707+
HoldingChangesFilterType_Increase = 1; // 增持
708+
HoldingChangesFilterType_Decrease = 2; // 减持
709+
HoldingChangesFilterType_NewIn = 3; // 建仓
710+
HoldingChangesFilterType_CloseOut = 4; // 清仓
711+
}
712+
713+
// 股东持仓明细机构类型
714+
enum HolderDetailType
715+
{
716+
HolderDetailType_Default = 0; // 默认不过滤,按服务端默认逻辑返回
717+
HolderDetailType_All = 1000; // 全部
718+
HolderDetailType_Unclassified = 1; // 其他机构
719+
HolderDetailType_TraditionalInvestmentManager = 2; // 传统投资经理
720+
HolderDetailType_HedgeFundManager = 3; // 对冲基金
721+
HolderDetailType_VCOrPE = 4; // 风险资本/私募股权投资
722+
HolderDetailType_CorporatePensionPlanSponsor = 5; // 企业年金
723+
HolderDetailType_FoundationFundSponsor = 6; // 基金会基金
724+
HolderDetailType_InsuranceCompany = 7; // 保险公司
725+
HolderDetailType_BankOrInvestmentBank = 8; // 银行/投资银行
726+
HolderDetailType_FamilyOfficesOrTrust = 9; // 家族办公室/信托
727+
HolderDetailType_SovereignWealthFund = 10; // 主权财富基金
728+
HolderDetailType_REIT = 11; // REIT
729+
HolderDetailType_StructuredFinancePoolManager = 12; // 结构化融资经理
730+
HolderDetailType_UnionPensionPlanSponsor = 13; // 联合养老金
731+
HolderDetailType_GovernmentPensionPlanSponsor = 14; // 政府养老金
732+
HolderDetailType_EndowmentFundSponsor = 15; // 捐赠基金
733+
HolderDetailType_IndividualInsiders = 100; // 个人
734+
HolderDetailType_IssueSponsoredADR = 200; // ADS
735+
HolderDetailType_CorporationsPublic = 300; // 上市公司
736+
HolderDetailType_CorporationsPrivate = 400; // 未公开上市公司
737+
HolderDetailType_StateOwnedShares = 500; // 国有股
738+
}
739+
740+
// 公司资料字段类型
741+
enum CompanyProfileFieldType
742+
{
743+
CompanyProfileFieldType_SourceText = 0; // 文本
744+
CompanyProfileFieldType_LinkType = 1; // 链接
745+
CompanyProfileFieldType_IndependentTitle = 2; // 独立标题
746+
}
747+
748+
// 券商净买卖方向
749+
enum BuySellType
750+
{
751+
BuySellType_Unknown = 0;
752+
BuySellType_NetBuy = 1; // 净买入
753+
BuySellType_NetSell = 2; // 净卖出
754+
}
755+
756+
// 期权波动率查询时间周期
757+
enum OptionVolatilityTimePeriodType
758+
{
759+
OptionVolatilityTimePeriodType_Unknown = 0; // 未知
760+
OptionVolatilityTimePeriodType_Week = 1; // 周
761+
OptionVolatilityTimePeriodType_Month = 2; // 月(默认)
762+
OptionVolatilityTimePeriodType_Quarter = 3; // 季度
763+
OptionVolatilityTimePeriodType_HalfYear = 4; // 半年
764+
OptionVolatilityTimePeriodType_Year = 5; // 年
765+
}
766+
767+
// 期权隐含波动率状态
768+
enum OptionImpvolStatusType
769+
{
770+
ImpvolFluctuating = 0; // 期权波动率处于震荡中
771+
ImpvolOvervalued = 1; // 期权波动率处于高估
772+
ImpvolUndervalued = 2; // 期权波动率处于低估
773+
}
774+
775+
//行情协议公共参数头
776+
message QotHeader
777+
{
778+
optional int32 securityFirm = 1; //券商标识,取值见 Trd_Common.SecurityFirm
779+
}
780+
567781
//两个字段确定一支股票
568782
message Security
569783
{
@@ -586,6 +800,7 @@ message KLine
586800
optional double pe = 11; //市盈率
587801
optional double changeRate = 12; //涨跌幅(该字段为百分比字段,默认不展示%,如20实际对应20%)
588802
optional double timestamp = 13; //时间戳
803+
optional double hpVolume = 14; //高精度成交量
589804
}
590805

591806
message OptionBasicQotExData
@@ -666,6 +881,7 @@ message BasicQot
666881
optional FutureBasicQotExData futureExData = 22; //期货特有字段
667882
optional WarrantBasicQotExData warrantExData = 23; //窝轮特有字段
668883
optional PreAfterMarketData overnight = 25; //夜盘数据
884+
optional double hpVolume = 26; //高精度成交量
669885
}
670886

671887
message TimeShare
@@ -679,6 +895,7 @@ message TimeShare
679895
optional int64 volume = 7; //成交量
680896
optional double turnover = 8; //成交额
681897
optional double timestamp = 9; //时间戳
898+
optional double hpVolume = 10; //高精度成交量
682899
}
683900

684901
message SecurityStaticBasic
@@ -754,6 +971,7 @@ message Ticker
754971
optional int32 typeSign = 9; //逐笔类型符号
755972
optional int32 pushDataType = 10; //用于区分推送情况
756973
optional double timestamp = 11; //时间戳
974+
optional double hpVolume = 12; //成交量
757975
}
758976

759977
message OrderBookDetail
@@ -768,6 +986,7 @@ message OrderBook
768986
required int64 volume = 2; //委托数量
769987
required int32 orederCount = 3; //委托订单个数
770988
repeated OrderBookDetail detailList = 4; //订单信息,SF行情特有
989+
optional double hpVolume = 5; //高精度委托数量
771990
}
772991

773992
//持股变动
@@ -793,6 +1012,7 @@ message ConnSubInfo
7931012
repeated SubInfo subInfoList = 1; //该连接订阅信息
7941013
required int32 usedQuota = 2; //该连接已经使用的订阅额度
7951014
required bool isOwnConnData = 3; //用于区分是否是自己连接的数据
1015+
optional int32 securityFirm = 4; //券商标识,取值见 Trd_Common.SecurityFirm
7961016
}
7971017

7981018
message PlateInfo

.proto/Qot_GetBasicQot.proto

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import "Qot_Common.proto";
99
message C2S
1010
{
1111
repeated Qot_Common.Security securityList = 1; //股票
12+
optional Qot_Common.QotHeader header = 100; //行情公共参数头
1213
}
1314

1415
message S2C

.proto/Qot_GetBroker.proto

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import "Qot_Common.proto";
99
message C2S
1010
{
1111
required Qot_Common.Security security = 1; //股票
12+
optional Qot_Common.QotHeader header = 100; //行情公共参数头
1213
}
1314

1415
message S2C

0 commit comments

Comments
 (0)