哪家券商的软件交易速度快?那个平台有极速柜台系统?成为了一个热门的话题,我来说下我的看法。其实呢,大部分的主流券商速度都是差不多的,否则的话,那速度有差距大家肯定都会冲向最快的那一家了。极速柜台系统呢,应该就是我们常说的通道。著名游资炒股养家就是个用通道顶一字板的好手。其实呢,这个通道只是起到一个锦上添花的作用,如果你实力不行,那么有通道也是没用的。
其实量化是未来的大势所趋,个人做的前提是你的策略经得起市场的考验,与机构量化不同,个人量化不可能追求速度和资金。其实他们可以广泛适应自己总结出来的投资逻辑,发现同样逻辑的人工投资洼地。不断修改完善,最终实现稳定盈利,开发不难,但是优化消耗精力,倒不如用现有的,最重要是现在哪些交易接口门槛低,获取也简单,而已也是直接对券商,使用比较安全。我们来看一些例子就知道了:
// 加载DLL
HINSTANCE hDLL = LoadLibraryA("MetaTrade.dll");
assert(hDLL);
// 初始化
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;
基本上大家的需求都能达到,而且还能做高频,这里就不一一列举了, 有兴趣的小伙伴也可以自己进一步了解。