gpt4 book ai didi

c++ - 使用 100 个符号时,交互式经纪人 api 落后于 tws

转载 作者:行者123 更新时间:2023-11-28 05:13:27 27 4
gpt4 key购买 nike

在我开始在屏幕上放置更多符号之前,我一直没有遇到这个问题。我不认为这是一个处理问题,我的 cpu 一直很好,而且我也没有做任何 super super 花哨的事情(只是将数据存储到对象并经常写入 txt 文件)。

从使用 api 的第一天开始,我注意到我必须在不断检查消息的 while 循环中放置一个 sleep(1),如下所示:

PosixTestClient client;
client.connect( host, port, clientId);
while( client.isConnected()) {
sleep(1);
client.processMessages();
}

如果我那里没有 sleep(1),它就会崩溃。所以我想我的第一个问题是:这正常吗?或者有什么问题吗?

我的下一个问题是...关于为什么 api 数据与 tws 数据相比可能存在滞后的任何提示?我知道有一个滞后,因为当数据进入 api 时,我将它存储到字符串中,然后每分钟将数据写入文本文件。然后我返回浏览我的文本文件并将其与 tws 中的图表进行比较……我注意到大约有 2 分钟的延迟!我还注意到,在交易日的前半个小时之后,情况似乎变得更好(滞后消失),当时交易非常活跃。

那么……有什么建议吗?

最佳答案

您是否订阅了 Booster 包?TWS API 有 100 个报价限制,以及 API。您可以花 30 美元购买额外的 100 个报价单。

Quote Booster Increase your allowance of simultaneous quotes windows by purchasing monthly Quote Booster packs at USD 30.00 per pack.

Each booster pack provides 100 simultaneous Level I quotes. Booster Pack quotes are additional to your monthly quote allotment from all sources, including commissions. Booster pack quotes are available for use in the desktop systems and in the API. Once subscribed, quotes are available immediately and will display the next time you log into the system. Data from a cancelled booster pack subscription remains available through the end of the current billing cycle. Limit of 10 Quote Booster packs per account.

关于c++ - 使用 100 个符号时,交互式经纪人 api 落后于 tws,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43122123/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com