get_holding_change_list get_holding_change_list(code, holder_type, start=None, end=None)
介绍
获取大股东持股变动列表
参数
参数 类型 说明 code str 股票代码 holder_type StockHolder 持有者类别 start str 开始时间 end str 结束时间
start 和 end 组合如下:
Start 类型 End 类型 说明 str str start 和 end 分别为指定的日期 None str start 为 end 往前 365 天 str None end 为 start 往后 365 天 None None end 为当前日期,start 为 end 往前 365 天
返回
参数 类型 说明 ret RET_CODE 接口调用结果 data pd.DataFrame 当 ret == RET_OK,返回持股变动数据 str 当 ret != RET_OK,返回错误描述
持股变动数据
字段 类型 说明 holder_name str 高管名称 holding_qty float 持股数 holding_ratio float 持股比例 该字段为百分比字段,默认不展示 %,如 20 实际对应 20%
change_qty float 变动数 change_ratio float 变动比例 相对于自身的比例 该字段为百分比字段,默认不展示 %,如 20 实际对应 20% 举例:总股本 1 万股,持有 100 股,持股百分比是 1%,卖掉 50 股,变动比例是 50 %,而不是 0.5% time str 发布时间
Example
from futu import *
quote_ctx = OpenQuoteContext( host= '127.0.0.1' , port= 11111 )
ret, data = quote_ctx. get_holding_change_list( 'US.AAPL' , StockHolder. INSTITUTE, '2018-10-01' )
if ret == RET_OK:
print ( data)
print ( data[ 'holding_ratio' ] [ 0 ] )
print ( data[ 'holding_ratio' ] . values. tolist( ) )
else :
print ( 'error:' , data)
quote_ctx. close( )
1 2 3 4 5 6 7 8 9 10 11
holder_name holding_qty holding_ratio change_qty change_ratio time
0 The Vanguard Group, Inc. 331132509.0 7.4525 - 3981157.0 - 1.19 2019 - 09 - 30 00 : 00 : 00
. . . . . . . . . . . . . . . . . . . .
92 Los Angeles Capital Management And Equity Rese. . . 4007663.0 0.0902 - 57784.0 - 1.42 2019 - 09 - 30 00 : 00 : 00
[ 93 rows x 6 columns]
7.4525
[ 7.4525 , 5.6004 , 4.3059 , 4.1463 , 2.1087 , 1.3884 , 1.0522 , 0.905 , 0.7931 , 0.7871 , 0.7782 , 0.6872 , 0.6687 , 0.666 , 0.6186 , 0.0956 , 0.0954 , 0.0903 ,
. . . . . . . . . . . . . . . . . . . .
0.0903 , 0.0902 ]
1 2 3 4 5 6 7 8 9 10
Qot_GetHoldingChangeList.proto message C2S
{
required Qot_Common. Security security = 1 ;
required int32 holderCategory = 2 ;
optional string beginTime = 3 ;
optional string endTime = 4 ;
}
message Request
{
required C2S c2s = 1 ;
}
1 2 3 4 5 6 7 8 9 10 11 12 13
message S2C
{
required Qot_Common. Security security = 1 ;
repeated Qot_Common. ShareHoldingChange holdingChangeList = 2 ;
}
message Response
{
required int32 retType = 1 [ default = - 400 ] ;
optional string retMsg = 2 ;
optional int32 errCode = 3 ;
optional S2C s2c = 4 ;
}
1 2 3 4 5 6 7 8 9 10 11 12 13
GetHoldingChangeList uint GetHoldingChangeList(QotGetHoldingChangeList.Request req);
virtual void OnReply_GetHoldingChangeList(FTAPI_Conn client, uint nSerialNo, QotGetHoldingChangeList.Response rsp);
获取大股东持股变动列表
message C2S
{
required Qot_Common. Security security = 1 ;
required int32 holderCategory = 2 ;
optional string beginTime = 3 ;
optional string endTime = 4 ;
}
message Request
{
required C2S c2s = 1 ;
}
1 2 3 4 5 6 7 8 9 10 11 12 13
message S2C
{
required Qot_Common. Security security = 1 ;
repeated Qot_Common. ShareHoldingChange holdingChangeList = 2 ;
}
message Response
{
required int32 retType = 1 [ default = - 400 ] ;
optional string retMsg = 2 ;
optional int32 errCode = 3 ;
optional S2C s2c = 4 ;
}
1 2 3 4 5 6 7 8 9 10 11 12 13
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 ( ) ;
QotGetHoldingChangeList. C2S c2s = QotGetHoldingChangeList. C2S. CreateBuilder ( )
. SetSecurity ( sec)
. SetHolderCategory ( ( int ) QotCommon. HolderCategory. HolderCategory_Agency)
. Build ( ) ;
QotGetHoldingChangeList. Request req = QotGetHoldingChangeList. Request. CreateBuilder ( ) . SetC2S ( c2s) . Build ( ) ;
uint seqNo = qot. GetHoldingChangeList ( req) ;
Console. Write ( "Send QotGetHoldingChangeList: {0}\n" , seqNo) ;
}
public void OnDisconnect ( FTAPI_Conn client, long errCode) {
Console. Write ( "Qot onDisConnect: {0}\n" , errCode) ;
}
public void OnReply_GetHoldingChangeList ( FTAPI_Conn client, uint nSerialNo, QotGetHoldingChangeList. Response rsp)
{
Console. Write ( "Reply: QotGetHoldingChangeList: {0}\n" , nSerialNo) ;
Console. Write ( "retMsg: {0}\n" , rsp. RetMsg) ;
}
public static void Main ( String[ ] args) {
FTAPI. Init ( ) ;
Program qot = new Program ( ) ;
qot. Start ( ) ;
while ( true )
Thread. Sleep ( 1000 * 600 ) ;
}
}
1 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
Qot onInitConnect: ret= 0 desc= connID= 6825949628551116548
Send QotGetHoldingChangeList: 3
Reply: QotGetHoldingChangeList: 3
retMsg: 因上游数据提供商的原因,获取大股东持股变动接口(协议ID:3208 )将于 2020 - 12 - 21 停止使用
1 2 3 4
getHoldingChangeList int getHoldingChangeList(QotGetHoldingChangeList.Request req);
void onReply_GetHoldingChangeList(FTAPI_Conn client, int nSerialNo, QotGetHoldingChangeList.Response rsp);
获取大股东持股变动列表
message C2S
{
required Qot_Common. Security security = 1 ;
required int32 holderCategory = 2 ;
optional string beginTime = 3 ;
optional string endTime = 4 ;
}
message Request
{
required C2S c2s = 1 ;
}
1 2 3 4 5 6 7 8 9 10 11 12 13
message S2C
{
required Qot_Common. Security security = 1 ;
repeated Qot_Common. ShareHoldingChange holdingChangeList = 2 ;
}
message Response
{
required int32 retType = 1 [ default = - 400 ] ;
optional string retMsg = 2 ;
optional int32 errCode = 3 ;
optional S2C s2c = 4 ;
}
1 2 3 4 5 6 7 8 9 10 11 12 13
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 ( ) ;
QotGetHoldingChangeList . C2S c2s = QotGetHoldingChangeList . C2S. newBuilder ( )
. setSecurity ( sec)
. setHolderCategory ( QotCommon. HolderCategory. HolderCategory_Agency_VALUE )
. build ( ) ;
QotGetHoldingChangeList. Request req = QotGetHoldingChangeList. Request . newBuilder ( ) . setC2S ( c2s) . build ( ) ;
int seqNo = qot. getHoldingChangeList ( req) ;
System . out. printf ( "Send QotGetHoldingChangeList: %d\n" , seqNo) ;
}
@Override
public void onDisconnect ( FTAPI_Conn client, long errCode) {
System . out. printf ( "Qot onDisConnect: %d\n" , errCode) ;
}
@Override
public void onReply_GetHoldingChangeList ( FTAPI_Conn client, int nSerialNo, QotGetHoldingChangeList. Response rsp) {
if ( rsp. getRetType ( ) != 0 ) {
System . out. printf ( "QotGetHoldingChangeList failed: %s\n" , rsp. getRetMsg ( ) ) ;
}
else {
try {
String json = JsonFormat . printer ( ) . print ( rsp) ;
System . out. printf ( "Receive QotGetHoldingChangeList: %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) {
}
}
}
}
1 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
Send QotGetHoldingChangeList: 2
QotGetHoldingChangeList failed: 因上游数据提供商的原因,获取大股东持股变动接口(协议ID:3208)将于 2020-12-21 停止使用
1 2
GetHoldingChangeList Futu::u32_t GetHoldingChangeList(const Qot_GetHoldingChangeList::Request &stReq);
virtual void OnReply_GetHoldingChangeList(Futu::u32_t nSerialNo, const Qot_GetHoldingChangeList::Response &stRsp) = 0;
message C2S
{
required Qot_Common. Security security = 1 ;
required int32 holderCategory = 2 ;
optional string beginTime = 3 ;
optional string endTime = 4 ;
}
message Request
{
required C2S c2s = 1 ;
}
1 2 3 4 5 6 7 8 9 10 11 12 13
message S2C
{
required Qot_Common. Security security = 1 ;
repeated Qot_Common. ShareHoldingChange holdingChangeList = 2 ;
}
message Response
{
required int32 retType = 1 [ default = - 400 ] ;
optional string retMsg = 2 ;
optional int32 errCode = 3 ;
optional S2C s2c = 4 ;
}
1 2 3 4 5 6 7 8 9 10 11 12 13
GetHoldingChangeList GetHoldingChangeList(req);
message C2S
{
required Qot_Common. Security security = 1 ;
required int32 holderCategory = 2 ;
optional string beginTime = 3 ;
optional string endTime = 4 ;
}
message Request
{
required C2S c2s = 1 ;
}
1 2 3 4 5 6 7 8 9 10 11 12 13
message S2C
{
required Qot_Common. Security security = 1 ;
repeated Qot_Common. ShareHoldingChange holdingChangeList = 2 ;
}
message Response
{
required int32 retType = 1 [ default = - 400 ] ;
optional string retMsg = 2 ;
optional int32 errCode = 3 ;
optional S2C s2c = 4 ;
}
1 2 3 4 5 6 7 8 9 10 11 12 13