# Get ARK Fund Holding
- Python
- Proto
- C#
- Java
- C++
- JavaScript
get_ark_fund_holding(holding_type=None, cycle_type=None, sort_field=None, sort_dir=None, count=None, page=None)
Description
Get ARK fund holdings, returning holding data for ARK ETFs, with support for viewing by holding/increase/decrease/open position/close position type, different time cycles, and multi-dimensional sorting.
Parameters
Parameter Type Description holding_type ArkHoldingType Holding type, default holdings cycle_type ArkCycleType Cycle type, default last 1 day (ignored when holdingType=holdings) sort_field ArkFundHoldingSortField Sort field, default holding quantity sort_dir RankSortDir Sort direction, default descending count int Return count [1, 200], default 20 page str Page cursor Return
Parameter Type Description ret RET_CODE API call result data pd.DataFrame When ret == RET_OK, returns data str When ret != RET_OK, returns error description - Data format:
Field Type Description security str Stock code (e.g. 'US.TSLA', some securities may be N/A)name str Name shares int Holding quantity shares_change int Holding quantity change market_value float Holding market value (USD) weight float Holding weight (%) weight_change float Holding weight change (%)
- Data format:
Example
from futu import *
quote_ctx = OpenQuoteContext(host='127.0.0.1', port=11111)
ret, data, next_page, all_count = quote_ctx.get_ark_fund_holding(count=2)
if ret == RET_OK:
print(f'Total count: {all_count}')
print(data)
else:
print('error:', data)
quote_ctx.close()
2
3
4
5
6
7
8
9
10
11
12
- Output
Total count: 2
security name shares shares_change market_value weight weight_change
0 N/A N/A 62494591 15631862 6.249459e+07 0.45 0.12
1 US.RXRX Recursion Pharmaceuticals 31671298 -71280 1.007147e+08 0.73 0.01
2
3
4
# Qot_GetArkFundHolding.proto
Description
Get ARK fund holdings, returning holding data for ARK ETFs, with support for viewing by holding/increase/decrease/open position/close position type, different time cycles, and multi-dimensional sorting.
Parameters
// ARK holding type
enum ArkHoldingType {
ArkHoldingType_Position = 0; // Holding
ArkHoldingType_Increase = 1; // Increase holding
ArkHoldingType_Decrease = 2; // Decrease holding
ArkHoldingType_New = 3; // Open position
ArkHoldingType_SoldOut = 4; // Close position
}
// Cycle type
enum CycleType {
CycleType_1Day = 0; // Last 1 day
CycleType_5Day = 1; // Last 5 days
CycleType_10Day = 2; // Last 10 days
CycleType_30Day = 3; // Last 30 days
CycleType_60Day = 4; // Last 60 days
}
// Sort field
enum SortField {
SortField_Shares = 0; // Holding quantity (default)
SortField_WeightChange = 1; // Ratio change
SortField_SharesChange = 2; // Holding change
SortField_MarketValue = 3; // Market cap
SortField_Weight = 4; // ETF ratio
}
// Sort direction
enum SortDir {
SortDir_Descending = 0; // Descending (default)
SortDir_Ascending = 1; // Ascending
}
message C2S {
optional int32 holdingType = 1; // ArkHoldingType, default holding
optional int32 cycleType = 2; // CycleType, default last 1 day (ignored when holdingType=holding)
optional int32 sortField = 3; // SortField, default by holding quantity descending
optional int32 sortDir = 4; // SortDir
optional int32 count = 5; // Count [1,200], default 20
optional string page = 6; // Page cursor, omit for first request
}
// ARK fund holding data item
message ArkFundHoldingItem {
optional Qot_Common.Security security = 1; // Stock (when stock_id is valid)
optional string name = 2; // Name
optional int64 shares = 3; // Holding quantity
optional int64 sharesChange = 4; // Holding quantity change
optional double marketValue = 5; // Holding market value (USD)
optional double weight = 6; // Holding ratio(%)
optional double weightChange = 7; // Holding ratio change(%)
}
message S2C {
repeated ArkFundHoldingItem dataList = 1; // Data list
optional int32 allCount = 2; // Total count
optional string nextPage = 3; // Next page cursor, empty=no more
}
message Request {
required C2S c2s = 1;
}
message Response {
required int32 retType = 1 [default = -400]; // RetType, return result
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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
Protocol ID
3423
uint GetArkFundHolding(Qot_GetArkFundHolding.Request req);
virtual void OnReply_GetArkFundHolding(FTAPI_Conn client, uint nSerialNo, Qot_GetArkFundHolding.Response rsp);
Description
Get ARK fund holdings, returning holding data for ARK ETFs, with support for viewing by holding/increase/decrease/open position/close position type, different time cycles, and multi-dimensional sorting.
Parameters
// ARK holding type
enum ArkHoldingType {
ArkHoldingType_Position = 0; // Holding
ArkHoldingType_Increase = 1; // Increase holding
ArkHoldingType_Decrease = 2; // Decrease holding
ArkHoldingType_New = 3; // Open position
ArkHoldingType_SoldOut = 4; // Close position
}
// Cycle type
enum CycleType {
CycleType_1Day = 0; // Last 1 day
CycleType_5Day = 1; // Last 5 days
CycleType_10Day = 2; // Last 10 days
CycleType_30Day = 3; // Last 30 days
CycleType_60Day = 4; // Last 60 days
}
// Sort field
enum SortField {
SortField_Shares = 0; // Holding quantity (default)
SortField_WeightChange = 1; // Ratio change
SortField_SharesChange = 2; // Holding change
SortField_MarketValue = 3; // Market cap
SortField_Weight = 4; // ETF ratio
}
// Sort direction
enum SortDir {
SortDir_Descending = 0; // Descending (default)
SortDir_Ascending = 1; // Ascending
}
message C2S {
optional int32 holdingType = 1; // ArkHoldingType, default holding
optional int32 cycleType = 2; // CycleType, default last 1 day (ignored when holdingType=holding)
optional int32 sortField = 3; // SortField, default by holding quantity descending
optional int32 sortDir = 4; // SortDir
optional int32 count = 5; // Count [1,200], default 20
optional string page = 6; // Page cursor, omit for first request
}
// ARK fund holding data item
message ArkFundHoldingItem {
optional Qot_Common.Security security = 1; // Stock (when stock_id is valid)
optional string name = 2; // Name
optional int64 shares = 3; // Holding quantity
optional int64 sharesChange = 4; // Holding quantity change
optional double marketValue = 5; // Holding market value (USD)
optional double weight = 6; // Holding ratio(%)
optional double weightChange = 7; // Holding ratio change(%)
}
message S2C {
repeated ArkFundHoldingItem dataList = 1; // Data list
optional int32 allCount = 2; // Total count
optional string nextPage = 3; // Next page cursor, empty=no more
}
message Request {
required C2S c2s = 1;
}
message Response {
required int32 retType = 1 [default = -400]; // RetType, return result
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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
- For interface result, refer to RetType
Protocol ID
3423
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;
QotGetArkFundHolding.C2S c2s = QotGetArkFundHolding.C2S.CreateBuilder()
.SetCount(3)
.Build();
QotGetArkFundHolding.Request req = QotGetArkFundHolding.Request.CreateBuilder().SetC2S(c2s).Build();
uint seqNo = qot.GetArkFundHolding(req);
Console.Write("Send QotGetArkFundHolding: {0}
", seqNo);
}
public void OnDisconnect(FTAPI_Conn client, long errCode) {
Console.Write("Qot onDisConnect: {0}
", errCode);
}
public void OnReply_GetArkFundHolding(FTAPI_Conn client, uint nSerialNo, QotGetArkFundHolding.Response rsp)
{
Console.Write("Reply: QotGetArkFundHolding: {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
- Output
Send QotGetArkFundHolding: 3
Reply: QotGetArkFundHolding: 3
GetArkFundHolding: errCode 0, retMsg , retType 0
{
"allCount": 20,
"dataList": [
{ "security": { "market": 11, "code": "RXRX" }, "name": "Recursion Pharmaceuticals", "shares": 31742578, "marketValue": 102528500.0, "weight": 0.72 },
{ "security": { "market": 11, "code": "ACHR" }, "name": "Archer Aviation", "shares": 29701570, "marketValue": 165437700.0, "weight": 1.17 }
]
}
2
3
4
5
6
7
8
9
10
int getArkFundHolding(Qot_GetArkFundHolding.Request req);
onReply_GetArkFundHolding(FTAPI_Conn client, int nSerialNo, Qot_GetArkFundHolding.Response rsp)
Description
Get ARK fund holdings, returning holding data for ARK ETFs, with support for viewing by holding/increase/decrease/open position/close position type, different time cycles, and multi-dimensional sorting.
Parameters
// ARK holding type
enum ArkHoldingType {
ArkHoldingType_Position = 0; // Holding
ArkHoldingType_Increase = 1; // Increase holding
ArkHoldingType_Decrease = 2; // Decrease holding
ArkHoldingType_New = 3; // Open position
ArkHoldingType_SoldOut = 4; // Close position
}
// Cycle type
enum CycleType {
CycleType_1Day = 0; // Last 1 day
CycleType_5Day = 1; // Last 5 days
CycleType_10Day = 2; // Last 10 days
CycleType_30Day = 3; // Last 30 days
CycleType_60Day = 4; // Last 60 days
}
// Sort field
enum SortField {
SortField_Shares = 0; // Holding quantity (default)
SortField_WeightChange = 1; // Ratio change
SortField_SharesChange = 2; // Holding change
SortField_MarketValue = 3; // Market cap
SortField_Weight = 4; // ETF ratio
}
// Sort direction
enum SortDir {
SortDir_Descending = 0; // Descending (default)
SortDir_Ascending = 1; // Ascending
}
message C2S {
optional int32 holdingType = 1; // ArkHoldingType, default holding
optional int32 cycleType = 2; // CycleType, default last 1 day (ignored when holdingType=holding)
optional int32 sortField = 3; // SortField, default by holding quantity descending
optional int32 sortDir = 4; // SortDir
optional int32 count = 5; // Count [1,200], default 20
optional string page = 6; // Page cursor, omit for first request
}
// ARK fund holding data item
message ArkFundHoldingItem {
optional Qot_Common.Security security = 1; // Stock (when stock_id is valid)
optional string name = 2; // Name
optional int64 shares = 3; // Holding quantity
optional int64 sharesChange = 4; // Holding quantity change
optional double marketValue = 5; // Holding market value (USD)
optional double weight = 6; // Holding ratio(%)
optional double weightChange = 7; // Holding ratio change(%)
}
message S2C {
repeated ArkFundHoldingItem dataList = 1; // Data list
optional int32 allCount = 2; // Total count
optional string nextPage = 3; // Next page cursor, empty=no more
}
message Request {
required C2S c2s = 1;
}
message Response {
required int32 retType = 1 [default = -400]; // RetType, return result
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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
- For interface result, refer to RetType
Protocol ID
3423
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;
QotGetArkFundHolding.C2S c2s = QotGetArkFundHolding.C2S.newBuilder()
.setCount(3)
.build();
QotGetArkFundHolding.Request req = QotGetArkFundHolding.Request.newBuilder().setC2S(c2s).build();
int seqNo = qot.getArkFundHolding(req);
System.out.printf("Send QotGetArkFundHolding: %d
", seqNo);
}
@Override
public void onDisconnect(FTAPI_Conn client, long errCode) {
System.out.printf("Qot onDisConnect: %d
", errCode);
}
@Override
public void onReply_GetArkFundHolding(FTAPI_Conn client, int nSerialNo, QotGetArkFundHolding.Response rsp) {
if (rsp.getRetType() != 0) {
System.out.printf("QotGetArkFundHolding failed: %s
", rsp.getRetMsg());
} else {
try {
String json = JsonFormat.printer().print(rsp);
System.out.printf("Receive QotGetArkFundHolding: %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
- Output
Send QotGetArkFundHolding: 3
Receive QotGetArkFundHolding: {
"allCount": 20,
"dataList": [
{ "security": { "market": 11, "code": "RXRX" }, "name": "Recursion Pharmaceuticals", "shares": 31742578, "marketValue": 102528500.0, "weight": 0.72 },
{ "security": { "market": 11, "code": "ACHR" }, "name": "Archer Aviation", "shares": 29701570, "marketValue": 165437700.0, "weight": 1.17 }
]
}
2
3
4
5
6
7
8
Futu::u32_t GetArkFundHolding(const Qot_GetArkFundHolding::Request &stReq);
virtual void OnReply_GetArkFundHolding(Futu::u32_t nSerialNo, const Qot_GetArkFundHolding::Response &stRsp) = 0;
Description
Protocol request and response definition
Parameters
// ARK holding type
enum ArkHoldingType {
ArkHoldingType_Position = 0; // Holding
ArkHoldingType_Increase = 1; // Increase holding
ArkHoldingType_Decrease = 2; // Decrease holding
ArkHoldingType_New = 3; // Open position
ArkHoldingType_SoldOut = 4; // Close position
}
// Cycle type
enum CycleType {
CycleType_1Day = 0; // Last 1 day
CycleType_5Day = 1; // Last 5 days
CycleType_10Day = 2; // Last 10 days
CycleType_30Day = 3; // Last 30 days
CycleType_60Day = 4; // Last 60 days
}
// Sort field
enum SortField {
SortField_Shares = 0; // Holding quantity (default)
SortField_WeightChange = 1; // Ratio change
SortField_SharesChange = 2; // Holding change
SortField_MarketValue = 3; // Market cap
SortField_Weight = 4; // ETF ratio
}
// Sort direction
enum SortDir {
SortDir_Descending = 0; // Descending (default)
SortDir_Ascending = 1; // Ascending
}
message C2S {
optional int32 holdingType = 1; // ArkHoldingType, default holding
optional int32 cycleType = 2; // CycleType, default last 1 day (ignored when holdingType=holding)
optional int32 sortField = 3; // SortField, default by holding quantity descending
optional int32 sortDir = 4; // SortDir
optional int32 count = 5; // Count [1,200], default 20
optional string page = 6; // Page cursor, omit for first request
}
// ARK fund holding data item
message ArkFundHoldingItem {
optional Qot_Common.Security security = 1; // Stock (when stock_id is valid)
optional string name = 2; // Name
optional int64 shares = 3; // Holding quantity
optional int64 sharesChange = 4; // Holding quantity change
optional double marketValue = 5; // Holding market value (USD)
optional double weight = 6; // Holding ratio(%)
optional double weightChange = 7; // Holding ratio change(%)
}
message S2C {
repeated ArkFundHoldingItem dataList = 1; // Data list
optional int32 allCount = 2; // Total count
optional string nextPage = 3; // Next page cursor, empty=no more
}
message Request {
required C2S c2s = 1;
}
message Response {
required int32 retType = 1 [default = -400]; // RetType, return result
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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
- For interface result, refer to RetType
Protocol ID
3423
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_GetArkFundHolding::Request req;
Qot_GetArkFundHolding::C2S *c2s = req.mutable_c2s();
c2s->set_count(20);
m_GetArkFundHoldingSerialNo = m_pQotApi->GetArkFundHolding(req);
}
virtual void OnReply_GetArkFundHolding(Futu::u32_t nSerialNo, const Qot_GetArkFundHolding::Response &stRsp) {
if (nSerialNo != m_GetArkFundHoldingSerialNo) return;
string resp_str;
ProtoBufToBodyData(stRsp, resp_str);
cout << UTF8ToLocal(resp_str) << endl;
}
protected:
FTAPI_Qot *m_pQotApi;
Futu::u32_t m_GetArkFundHoldingSerialNo = 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
- Output
{
"retType": 0,
"retMsg": "",
"errCode": 0,
"s2c": {
"dataList": [
{
"security": {
"market": 11,
"code": "TSLA"
},
"name": "Tesla",
"shares": 5000000,
"sharesChange": 50000,
"marketValue": 1250000000.0,
"weight": 8.5,
"weightChange": 0.2
}
],
"allCount": 30
}
}
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
getArkFundHolding(qotGetArkFundHolding)
Description
Get ARK fund holdings, returning holding data for ARK ETFs, with support for viewing by holding/increase/decrease/open position/close position type, different time cycles, and multi-dimensional sorting.
Parameters
// ARK holding type
enum ArkHoldingType {
ArkHoldingType_Position = 0; // Holding
ArkHoldingType_Increase = 1; // Increase holding
ArkHoldingType_Decrease = 2; // Decrease holding
ArkHoldingType_New = 3; // Open position
ArkHoldingType_SoldOut = 4; // Close position
}
// Cycle type
enum CycleType {
CycleType_1Day = 0; // Last 1 day
CycleType_5Day = 1; // Last 5 days
CycleType_10Day = 2; // Last 10 days
CycleType_30Day = 3; // Last 30 days
CycleType_60Day = 4; // Last 60 days
}
// Sort field
enum SortField {
SortField_Shares = 0; // Holding quantity (default)
SortField_WeightChange = 1; // Ratio change
SortField_SharesChange = 2; // Holding change
SortField_MarketValue = 3; // Market cap
SortField_Weight = 4; // ETF ratio
}
// Sort direction
enum SortDir {
SortDir_Descending = 0; // Descending (default)
SortDir_Ascending = 1; // Ascending
}
message C2S {
optional int32 holdingType = 1; // ArkHoldingType, default holding
optional int32 cycleType = 2; // CycleType, default last 1 day (ignored when holdingType=holding)
optional int32 sortField = 3; // SortField, default by holding quantity descending
optional int32 sortDir = 4; // SortDir
optional int32 count = 5; // Count [1,200], default 20
optional string page = 6; // Page cursor, omit for first request
}
// ARK fund holding data item
message ArkFundHoldingItem {
optional Qot_Common.Security security = 1; // Stock (when stock_id is valid)
optional string name = 2; // Name
optional int64 shares = 3; // Holding quantity
optional int64 sharesChange = 4; // Holding quantity change
optional double marketValue = 5; // Holding market value (USD)
optional double weight = 6; // Holding ratio(%)
optional double weightChange = 7; // Holding ratio change(%)
}
message S2C {
repeated ArkFundHoldingItem dataList = 1; // Data list
optional int32 allCount = 2; // Total count
optional string nextPage = 3; // Next page cursor, empty=no more
}
message Request {
required C2S c2s = 1;
}
message Response {
required int32 retType = 1 [default = -400]; // RetType, return result
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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
- For interface result, refer to RetType
Protocol ID
3423
Example
import ftWebsocket from "futu-api";
import { Common, Qot_Common } from "futu-api/proto";
import beautify from "js-beautify";
function QotGetArkFundHolding(){
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: { count: 3 },
};
websocket.GetArkFundHolding(req)
.then((res)=>{
let { errCode, retMsg, retType, s2c } = res
console.log("GetArkFundHolding: 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);
}
QotGetArkFundHolding()
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
- Output
GetArkFundHolding: errCode 0, retMsg , retType 0
{
"allCount": 20,
"dataList": [
{ "security": { "market": 11, "code": "RXRX" }, "name": "Recursion Pharmaceuticals", "shares": 31742578, "marketValue": 102528500.0, "weight": 0.72 },
{ "security": { "market": 11, "code": "ACHR" }, "name": "Archer Aviation", "shares": 29701570, "marketValue": 165437700.0, "weight": 1.17 }
]
}
2
3
4
5
6
7
8
API Limits
- Maximum 60 requests within 30 seconds
- Only the first page of paginated requests counts toward rate limiting
- Python
- Proto
- C#
- Java
- C++
- JavaScript
get_ark_fund_holding(holding_type=None, cycle_type=None, sort_field=None, sort_dir=None, count=None, page=None)
Description
Get ARK fund holdings, returning holding data for ARK ETFs, with support for viewing by holding/increase/decrease/open position/close position type, different time cycles, and multi-dimensional sorting.
Parameters
Parameter Type Description holding_type ArkHoldingType Holding type, default holdings cycle_type ArkCycleType Cycle type, default last 1 day (ignored when holdingType=holdings) sort_field ArkFundHoldingSortField Sort field, default holding quantity sort_dir RankSortDir Sort direction, default descending count int Return count [1, 200], default 20 page str Page cursor Return
Parameter Type Description ret RET_CODE API call result data pd.DataFrame When ret == RET_OK, returns data str When ret != RET_OK, returns error description - Data format:
Field Type Description security str Stock code (e.g. 'US.TSLA', some securities may be N/A)name str Name shares int Holding quantity shares_change int Holding quantity change market_value float Holding market value (USD) weight float Holding weight (%) weight_change float Holding weight change (%)
- Data format:
Example
from futu import *
quote_ctx = OpenQuoteContext(host='127.0.0.1', port=11111)
ret, data, next_page, all_count = quote_ctx.get_ark_fund_holding(count=2)
if ret == RET_OK:
print(f'Total count: {all_count}')
print(data)
else:
print('error:', data)
quote_ctx.close()
2
3
4
5
6
7
8
9
10
11
12
- Output
Total count: 2
security name shares shares_change market_value weight weight_change
0 N/A N/A 62494591 15631862 6.249459e+07 0.45 0.12
1 US.RXRX Recursion Pharmaceuticals 31671298 -71280 1.007147e+08 0.73 0.01
2
3
4
# Qot_GetArkFundHolding.proto
Description
Get ARK fund holdings, returning holding data for ARK ETFs, with support for viewing by holding/increase/decrease/open position/close position type, different time cycles, and multi-dimensional sorting.
Parameters
// ARK holding type
enum ArkHoldingType {
ArkHoldingType_Position = 0; // Holding
ArkHoldingType_Increase = 1; // Increase holding
ArkHoldingType_Decrease = 2; // Decrease holding
ArkHoldingType_New = 3; // Open position
ArkHoldingType_SoldOut = 4; // Close position
}
// Cycle type
enum CycleType {
CycleType_1Day = 0; // Last 1 day
CycleType_5Day = 1; // Last 5 days
CycleType_10Day = 2; // Last 10 days
CycleType_30Day = 3; // Last 30 days
CycleType_60Day = 4; // Last 60 days
}
// Sort field
enum SortField {
SortField_Shares = 0; // Holding quantity (default)
SortField_WeightChange = 1; // Ratio change
SortField_SharesChange = 2; // Holding change
SortField_MarketValue = 3; // Market cap
SortField_Weight = 4; // ETF ratio
}
// Sort direction
enum SortDir {
SortDir_Descending = 0; // Descending (default)
SortDir_Ascending = 1; // Ascending
}
message C2S {
optional int32 holdingType = 1; // ArkHoldingType, default holding
optional int32 cycleType = 2; // CycleType, default last 1 day (ignored when holdingType=holding)
optional int32 sortField = 3; // SortField, default by holding quantity descending
optional int32 sortDir = 4; // SortDir
optional int32 count = 5; // Count [1,200], default 20
optional string page = 6; // Page cursor, omit for first request
}
// ARK fund holding data item
message ArkFundHoldingItem {
optional Qot_Common.Security security = 1; // Stock (when stock_id is valid)
optional string name = 2; // Name
optional int64 shares = 3; // Holding quantity
optional int64 sharesChange = 4; // Holding quantity change
optional double marketValue = 5; // Holding market value (USD)
optional double weight = 6; // Holding ratio(%)
optional double weightChange = 7; // Holding ratio change(%)
}
message S2C {
repeated ArkFundHoldingItem dataList = 1; // Data list
optional int32 allCount = 2; // Total count
optional string nextPage = 3; // Next page cursor, empty=no more
}
message Request {
required C2S c2s = 1;
}
message Response {
required int32 retType = 1 [default = -400]; // RetType, return result
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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
Protocol ID
3423
uint GetArkFundHolding(Qot_GetArkFundHolding.Request req);
virtual void OnReply_GetArkFundHolding(FTAPI_Conn client, uint nSerialNo, Qot_GetArkFundHolding.Response rsp);
Description
Get ARK fund holdings, returning holding data for ARK ETFs, with support for viewing by holding/increase/decrease/open position/close position type, different time cycles, and multi-dimensional sorting.
Parameters
// ARK holding type
enum ArkHoldingType {
ArkHoldingType_Position = 0; // Holding
ArkHoldingType_Increase = 1; // Increase holding
ArkHoldingType_Decrease = 2; // Decrease holding
ArkHoldingType_New = 3; // Open position
ArkHoldingType_SoldOut = 4; // Close position
}
// Cycle type
enum CycleType {
CycleType_1Day = 0; // Last 1 day
CycleType_5Day = 1; // Last 5 days
CycleType_10Day = 2; // Last 10 days
CycleType_30Day = 3; // Last 30 days
CycleType_60Day = 4; // Last 60 days
}
// Sort field
enum SortField {
SortField_Shares = 0; // Holding quantity (default)
SortField_WeightChange = 1; // Ratio change
SortField_SharesChange = 2; // Holding change
SortField_MarketValue = 3; // Market cap
SortField_Weight = 4; // ETF ratio
}
// Sort direction
enum SortDir {
SortDir_Descending = 0; // Descending (default)
SortDir_Ascending = 1; // Ascending
}
message C2S {
optional int32 holdingType = 1; // ArkHoldingType, default holding
optional int32 cycleType = 2; // CycleType, default last 1 day (ignored when holdingType=holding)
optional int32 sortField = 3; // SortField, default by holding quantity descending
optional int32 sortDir = 4; // SortDir
optional int32 count = 5; // Count [1,200], default 20
optional string page = 6; // Page cursor, omit for first request
}
// ARK fund holding data item
message ArkFundHoldingItem {
optional Qot_Common.Security security = 1; // Stock (when stock_id is valid)
optional string name = 2; // Name
optional int64 shares = 3; // Holding quantity
optional int64 sharesChange = 4; // Holding quantity change
optional double marketValue = 5; // Holding market value (USD)
optional double weight = 6; // Holding ratio(%)
optional double weightChange = 7; // Holding ratio change(%)
}
message S2C {
repeated ArkFundHoldingItem dataList = 1; // Data list
optional int32 allCount = 2; // Total count
optional string nextPage = 3; // Next page cursor, empty=no more
}
message Request {
required C2S c2s = 1;
}
message Response {
required int32 retType = 1 [default = -400]; // RetType, return result
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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
- For interface result, refer to RetType
Protocol ID
3423
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;
QotGetArkFundHolding.C2S c2s = QotGetArkFundHolding.C2S.CreateBuilder()
.SetCount(3)
.Build();
QotGetArkFundHolding.Request req = QotGetArkFundHolding.Request.CreateBuilder().SetC2S(c2s).Build();
uint seqNo = qot.GetArkFundHolding(req);
Console.Write("Send QotGetArkFundHolding: {0}
", seqNo);
}
public void OnDisconnect(MMAPI_Conn client, long errCode) {
Console.Write("Qot onDisConnect: {0}
", errCode);
}
public void OnReply_GetArkFundHolding(MMAPI_Conn client, uint nSerialNo, QotGetArkFundHolding.Response rsp)
{
Console.Write("Reply: QotGetArkFundHolding: {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
- Output
Send QotGetArkFundHolding: 3
Reply: QotGetArkFundHolding: 3
GetArkFundHolding: errCode 0, retMsg , retType 0
{
"allCount": 20,
"dataList": [
{ "security": { "market": 11, "code": "RXRX" }, "name": "Recursion Pharmaceuticals", "shares": 31742578, "marketValue": 102528500.0, "weight": 0.72 },
{ "security": { "market": 11, "code": "ACHR" }, "name": "Archer Aviation", "shares": 29701570, "marketValue": 165437700.0, "weight": 1.17 }
]
}
2
3
4
5
6
7
8
9
10
int getArkFundHolding(Qot_GetArkFundHolding.Request req);
onReply_GetArkFundHolding(FTAPI_Conn client, int nSerialNo, Qot_GetArkFundHolding.Response rsp)
Description
Get ARK fund holdings, returning holding data for ARK ETFs, with support for viewing by holding/increase/decrease/open position/close position type, different time cycles, and multi-dimensional sorting.
Parameters
// ARK holding type
enum ArkHoldingType {
ArkHoldingType_Position = 0; // Holding
ArkHoldingType_Increase = 1; // Increase holding
ArkHoldingType_Decrease = 2; // Decrease holding
ArkHoldingType_New = 3; // Open position
ArkHoldingType_SoldOut = 4; // Close position
}
// Cycle type
enum CycleType {
CycleType_1Day = 0; // Last 1 day
CycleType_5Day = 1; // Last 5 days
CycleType_10Day = 2; // Last 10 days
CycleType_30Day = 3; // Last 30 days
CycleType_60Day = 4; // Last 60 days
}
// Sort field
enum SortField {
SortField_Shares = 0; // Holding quantity (default)
SortField_WeightChange = 1; // Ratio change
SortField_SharesChange = 2; // Holding change
SortField_MarketValue = 3; // Market cap
SortField_Weight = 4; // ETF ratio
}
// Sort direction
enum SortDir {
SortDir_Descending = 0; // Descending (default)
SortDir_Ascending = 1; // Ascending
}
message C2S {
optional int32 holdingType = 1; // ArkHoldingType, default holding
optional int32 cycleType = 2; // CycleType, default last 1 day (ignored when holdingType=holding)
optional int32 sortField = 3; // SortField, default by holding quantity descending
optional int32 sortDir = 4; // SortDir
optional int32 count = 5; // Count [1,200], default 20
optional string page = 6; // Page cursor, omit for first request
}
// ARK fund holding data item
message ArkFundHoldingItem {
optional Qot_Common.Security security = 1; // Stock (when stock_id is valid)
optional string name = 2; // Name
optional int64 shares = 3; // Holding quantity
optional int64 sharesChange = 4; // Holding quantity change
optional double marketValue = 5; // Holding market value (USD)
optional double weight = 6; // Holding ratio(%)
optional double weightChange = 7; // Holding ratio change(%)
}
message S2C {
repeated ArkFundHoldingItem dataList = 1; // Data list
optional int32 allCount = 2; // Total count
optional string nextPage = 3; // Next page cursor, empty=no more
}
message Request {
required C2S c2s = 1;
}
message Response {
required int32 retType = 1 [default = -400]; // RetType, return result
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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
- For interface result, refer to RetType
Protocol ID
3423
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;
QotGetArkFundHolding.C2S c2s = QotGetArkFundHolding.C2S.newBuilder()
.setCount(3)
.build();
QotGetArkFundHolding.Request req = QotGetArkFundHolding.Request.newBuilder().setC2S(c2s).build();
int seqNo = qot.getArkFundHolding(req);
System.out.printf("Send QotGetArkFundHolding: %d
", seqNo);
}
@Override
public void onDisconnect(MMAPI_Conn client, long errCode) {
System.out.printf("Qot onDisConnect: %d
", errCode);
}
@Override
public void onReply_GetArkFundHolding(MMAPI_Conn client, int nSerialNo, QotGetArkFundHolding.Response rsp) {
if (rsp.getRetType() != 0) {
System.out.printf("QotGetArkFundHolding failed: %s
", rsp.getRetMsg());
} else {
try {
String json = JsonFormat.printer().print(rsp);
System.out.printf("Receive QotGetArkFundHolding: %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
- Output
Send QotGetArkFundHolding: 3
Receive QotGetArkFundHolding: {
"allCount": 20,
"dataList": [
{ "security": { "market": 11, "code": "RXRX" }, "name": "Recursion Pharmaceuticals", "shares": 31742578, "marketValue": 102528500.0, "weight": 0.72 },
{ "security": { "market": 11, "code": "ACHR" }, "name": "Archer Aviation", "shares": 29701570, "marketValue": 165437700.0, "weight": 1.17 }
]
}
2
3
4
5
6
7
8
moomoo::u32_t GetArkFundHolding(const Qot_GetArkFundHolding::Request &stReq);
virtual void OnReply_GetArkFundHolding(moomoo::u32_t nSerialNo, const Qot_GetArkFundHolding::Response &stRsp) = 0;
Description
Protocol request and response definition
Parameters
// ARK holding type
enum ArkHoldingType {
ArkHoldingType_Position = 0; // Holding
ArkHoldingType_Increase = 1; // Increase holding
ArkHoldingType_Decrease = 2; // Decrease holding
ArkHoldingType_New = 3; // Open position
ArkHoldingType_SoldOut = 4; // Close position
}
// Cycle type
enum CycleType {
CycleType_1Day = 0; // Last 1 day
CycleType_5Day = 1; // Last 5 days
CycleType_10Day = 2; // Last 10 days
CycleType_30Day = 3; // Last 30 days
CycleType_60Day = 4; // Last 60 days
}
// Sort field
enum SortField {
SortField_Shares = 0; // Holding quantity (default)
SortField_WeightChange = 1; // Ratio change
SortField_SharesChange = 2; // Holding change
SortField_MarketValue = 3; // Market cap
SortField_Weight = 4; // ETF ratio
}
// Sort direction
enum SortDir {
SortDir_Descending = 0; // Descending (default)
SortDir_Ascending = 1; // Ascending
}
message C2S {
optional int32 holdingType = 1; // ArkHoldingType, default holding
optional int32 cycleType = 2; // CycleType, default last 1 day (ignored when holdingType=holding)
optional int32 sortField = 3; // SortField, default by holding quantity descending
optional int32 sortDir = 4; // SortDir
optional int32 count = 5; // Count [1,200], default 20
optional string page = 6; // Page cursor, omit for first request
}
// ARK fund holding data item
message ArkFundHoldingItem {
optional Qot_Common.Security security = 1; // Stock (when stock_id is valid)
optional string name = 2; // Name
optional int64 shares = 3; // Holding quantity
optional int64 sharesChange = 4; // Holding quantity change
optional double marketValue = 5; // Holding market value (USD)
optional double weight = 6; // Holding ratio(%)
optional double weightChange = 7; // Holding ratio change(%)
}
message S2C {
repeated ArkFundHoldingItem dataList = 1; // Data list
optional int32 allCount = 2; // Total count
optional string nextPage = 3; // Next page cursor, empty=no more
}
message Request {
required C2S c2s = 1;
}
message Response {
required int32 retType = 1 [default = -400]; // RetType, return result
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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
- For interface result, refer to RetType
Protocol ID
3423
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_GetArkFundHolding::Request req;
Qot_GetArkFundHolding::C2S *c2s = req.mutable_c2s();
c2s->set_count(20);
m_GetArkFundHoldingSerialNo = m_pQotApi->GetArkFundHolding(req);
}
virtual void OnReply_GetArkFundHolding(moomoo::u32_t nSerialNo, const Qot_GetArkFundHolding::Response &stRsp) {
if (nSerialNo != m_GetArkFundHoldingSerialNo) return;
string resp_str;
ProtoBufToBodyData(stRsp, resp_str);
cout << UTF8ToLocal(resp_str) << endl;
}
protected:
MMAPI_Qot *m_pQotApi;
moomoo::u32_t m_GetArkFundHoldingSerialNo = 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
- Output
{
"retType": 0,
"retMsg": "",
"errCode": 0,
"s2c": {
"dataList": [
{
"security": {
"market": 11,
"code": "TSLA"
},
"name": "Tesla",
"shares": 5000000,
"sharesChange": 50000,
"marketValue": 1250000000.0,
"weight": 8.5,
"weightChange": 0.2
}
],
"allCount": 30
}
}
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
getArkFundHolding(qotGetArkFundHolding)
Description
Get ARK fund holdings, returning holding data for ARK ETFs, with support for viewing by holding/increase/decrease/open position/close position type, different time cycles, and multi-dimensional sorting.
Parameters
// ARK holding type
enum ArkHoldingType {
ArkHoldingType_Position = 0; // Holding
ArkHoldingType_Increase = 1; // Increase holding
ArkHoldingType_Decrease = 2; // Decrease holding
ArkHoldingType_New = 3; // Open position
ArkHoldingType_SoldOut = 4; // Close position
}
// Cycle type
enum CycleType {
CycleType_1Day = 0; // Last 1 day
CycleType_5Day = 1; // Last 5 days
CycleType_10Day = 2; // Last 10 days
CycleType_30Day = 3; // Last 30 days
CycleType_60Day = 4; // Last 60 days
}
// Sort field
enum SortField {
SortField_Shares = 0; // Holding quantity (default)
SortField_WeightChange = 1; // Ratio change
SortField_SharesChange = 2; // Holding change
SortField_MarketValue = 3; // Market cap
SortField_Weight = 4; // ETF ratio
}
// Sort direction
enum SortDir {
SortDir_Descending = 0; // Descending (default)
SortDir_Ascending = 1; // Ascending
}
message C2S {
optional int32 holdingType = 1; // ArkHoldingType, default holding
optional int32 cycleType = 2; // CycleType, default last 1 day (ignored when holdingType=holding)
optional int32 sortField = 3; // SortField, default by holding quantity descending
optional int32 sortDir = 4; // SortDir
optional int32 count = 5; // Count [1,200], default 20
optional string page = 6; // Page cursor, omit for first request
}
// ARK fund holding data item
message ArkFundHoldingItem {
optional Qot_Common.Security security = 1; // Stock (when stock_id is valid)
optional string name = 2; // Name
optional int64 shares = 3; // Holding quantity
optional int64 sharesChange = 4; // Holding quantity change
optional double marketValue = 5; // Holding market value (USD)
optional double weight = 6; // Holding ratio(%)
optional double weightChange = 7; // Holding ratio change(%)
}
message S2C {
repeated ArkFundHoldingItem dataList = 1; // Data list
optional int32 allCount = 2; // Total count
optional string nextPage = 3; // Next page cursor, empty=no more
}
message Request {
required C2S c2s = 1;
}
message Response {
required int32 retType = 1 [default = -400]; // RetType, return result
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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
- For interface result, refer to RetType
Protocol ID
3423
Example
import mmWebsocket from "moomoo-api";
import { Common, Qot_Common } from "moomoo-api/proto";
import beautify from "js-beautify";
function QotGetArkFundHolding(){
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: { count: 3 },
};
websocket.GetArkFundHolding(req)
.then((res)=>{
let { errCode, retMsg, retType, s2c } = res
console.log("GetArkFundHolding: 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);
}
QotGetArkFundHolding()
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
- Output
GetArkFundHolding: errCode 0, retMsg , retType 0
{
"allCount": 20,
"dataList": [
{ "security": { "market": 11, "code": "RXRX" }, "name": "Recursion Pharmaceuticals", "shares": 31742578, "marketValue": 102528500.0, "weight": 0.72 },
{ "security": { "market": 11, "code": "ACHR" }, "name": "Archer Aviation", "shares": 29701570, "marketValue": 165437700.0, "weight": 1.17 }
]
}
2
3
4
5
6
7
8
API Limits
- Maximum 60 requests within 30 seconds
- Only the first page of paginated requests counts toward rate limiting