分享通达信软件L2接口获取数据的执行过程

在股票交易市场领域当中,通达信软件L2接口获取股票数据,用户根据得到的股票数据信息,做出合理的交易决策,让股票交易活动顺利进行。

通达信软件L2接口提供数据支撑,有了这些股票数据,经过了分析才能真实反映股票市场情况,完成交易。

通达信软件L2接口的登录操作:

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

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,

扫描二维码关注公众号,回复: 15020310 查看本文章

                         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;

所以说,通达信软件L2接口的股票数据看起来复杂,其实也不是很复杂,但需要掌握一定的编程知识。通达信软件L2接口获取数据的执行过程就分享到这了~有关L2接口的资讯,可找一下下方的qq名片了解~或者到这https://gitee.com/l2gogogo了解!

猜你喜欢

转载自blog.csdn.net/Q_2037696191/article/details/128564277
今日推荐