joinquant量化数据精准吗?

在股票量化投资中,joinquant量化数据起到很大的作用,因为joinquant量化平台的数据能够从众多只股票数据中,能够一一罗列出来,也就是说,joinquant量化数据可以在计算和分析数据模型中,能够帮助投资者找到他们使用数据情况。那么,joinquant量化数据会精准吗?

从分析的数据方面来看,joinquant量化可以挖掘这些数据模块能够发现很多奥秘:

(1)股票交易接口进行单账户批量查询:

签名

void QueryDatas(int ClientId, int Category[], int Count, char* Result[], char* ErrorInfo[]);

功能

单账户批量查询各类交易数据, 通过下标区分每项查询

参数

ClientId

客户端Id

Category[]

查询信息类别数组, 具体含义请参阅[查询信息类别]

Count

查询项数, 即数组长度

Result[]

查询结果数组, 每项结果需要分配 1024*1024 字节的空间

格式请参阅[Result 格式]

ErrorInfo[]

错误信息数组, 每项错误信息需要分配 256 字节的空间

返回值

无, 第 i 项查询成功与否通过 ErrorInfo[i]是否为空字符串来判断

(2)多账户批量查询:

签名

void QueryMultiAccountsDatas(int ClientId[], int Category[], int Count,

char* Result[], char* ErrorInfo[]);

功能

多账户批量查询各类交易数据, 通过下标区分每项查询

参数

ClientId[]

客户端Id 数组

Category[]

查询信息类别数组, 具体含义请参阅[查询信息类别]

Count

查询项数, 即数组长度

Result[]

查询结果数组, 每项结果需要分配 1024*1024 字节的空间

格式请参阅[Result 格式]

ErrorInfo[]

错误信息数组, 每项错误信息需要分配 256 字节的空间

返回值

无, 第 i 项查询成功与否通过 ErrorInfo[i]是否为空字符串来判断

但其实,joinquant量化数据的查询,不管是单账户还是多账户,都能精准的执行出来,常见的查询程序:

// 初始化

typedef int (*InitProc)();

const auto Init = reinterpret_cast<InitProc>(GetProcAddress(hDLL, "Init"));

assert(Init);

const int authorizedCount = Init(); // 已授权账号数量

assert(authorizedCount > 0);

std::cout << "已授权账号数量: " << authorizedCount << std::endl;

std::cout << std::endl;

// 接收缓冲区, 用于接收返回结果和错误信息

auto resultBuf = std::make_unique<char[]>(1024 * 1024);

auto errinfoBuf = std::make_unique<char[]>(256);

char *const result = resultBuf.get();

char *const errinfo = errinfoBuf.get();

// 登录 接口支持普通交易和两融交易账号, 以下例子使用两融账号

typedef int (*LogonProc)(const char *ip, short port, const char *version,

short yybid, const char *account,

const char *tradeAccount, const char *jyPassword,

const char *txPassword, char *errinfo);

const auto Logon = reinterpret_cast<LogonProc>(GetProcAddress(hDLL, "Logon"));

assert(Logon);

std::string ip = "1.2.3.4"; // 券商IP(注意区分两融和普通)

short port = 5678; // 券商端口(注意区分两融和普通)

std::string version = ""; // 版本号: 一般填空

short yybid = 0; // 营业部ID: 一般填0

std::string account = "12345678.C"; // 登录账号: 两融账号需添加.C结尾

std::string tradeAccount = "12345678"; // 交易账号: 一般与登录账号相同, 但不需添加.C结尾

std::string jyPassword = "password"; // 交易密码

std::string txPassword = ""; // 通讯密码: 一般填空

const int clientId = Logon(ip.c_str(), port, version.c_str(), yybid,

account.c_str(), tradeAccount.c_str(),

jyPassword.c_str(), txPassword.c_str(), errinfo);

assert(clientId >= 0);

std::cout << "登录成功, client = " << clientId << std::endl;

std::cout << std::endl;

输出结果示例:

猜你喜欢

转载自blog.csdn.net/Q_121463726/article/details/128677307