来自盈透代理 API 的随机响应



我在他们的API中使用了IB提供的样本,但我得到了绝对(至少从我所看到的(随机结果,这里有一些日志:

main (16:32:27): REQ: secDef 1
main (16:32:27): REQ: rfq 1528036347
AWT-EventQueue-0 (16:32:27): Error id=-1 code=2104 msg=Market data farm connection is OK:usfuture
AWT-EventQueue-0 (16:32:27): Error id=-1 code=2104 msg=Market data farm connection is OK:eufarm
AWT-EventQueue-0 (16:32:27): Error id=-1 code=2104 msg=Market data farm connection is OK:usopt
AWT-EventQueue-0 (16:32:27): Error id=-1 code=2104 msg=Market data farm connection is OK:usfarm
AWT-EventQueue-0 (16:32:27): Error id=-1 code=2106 msg=HMDS data farm connection is OK:euhmds
AWT-EventQueue-0 (16:32:27): Error id=-1 code=2106 msg=HMDS data farm connection is OK:ushmds
AWT-EventQueue-0 (16:32:27): Error id=-1 code=2104 msg=Market data farm connection is OK:usfuture
AWT-EventQueue-0 (16:32:27): Error id=-1 code=2104 msg=Market data farm connection is OK:eufarm
AWT-EventQueue-0 (16:32:27): Error id=-1 code=2104 msg=Market data farm connection is OK:usopt
AWT-EventQueue-0 (16:32:27): Error id=-1 code=2104 msg=Market data farm connection is OK:usfarm
AWT-EventQueue-0 (16:32:27): Error id=-1 code=2106 msg=HMDS data farm connection is OK:euhmds
AWT-EventQueue-0 (16:32:27): Error id=-1 code=2106 msg=HMDS data farm connection is OK:ushmds
AWT-EventQueue-0 (16:32:27): tickPrice:1 field:68 (delayedLast) value:1.55
AWT-EventQueue-0 (16:32:27): tickPrice:1 field:66 (delayedBid) value:1.51
AWT-EventQueue-0 (16:32:27): tickPrice:1 field:67 (delayedAsk) value:1.56
AWT-EventQueue-0 (16:32:27): tickPrice:1 field:72 (delayedHigh) value:2.1
AWT-EventQueue-0 (16:32:27): tickPrice:1 field:73 (delayedLow) value:1.48
AWT-EventQueue-0 (16:32:27): tickSize:1 field:74 (delayedVolume) value:161
AWT-EventQueue-0 (16:32:27): tickPrice:1 field:75 (delayedClose) value:1.47
AWT-EventQueue-0 (16:32:27): Error id=1 code=10090 msg=Part of requested market data is not subscribed. Subscription-independent ticks are still active.Delayed market data is available.IBM NYSE/TOP/ALL

请注意,尽管Error,我仍然收到了延迟的价格。 现在(28 秒后(我在不接触任何东西的情况下重新启动完全相同的样本:

main (16:32:55): REQ: secDef 1
main (16:32:55): REQ: rfq 1528036375
AWT-EventQueue-0 (16:32:55): Error id=-1 code=2104 msg=Market data farm connection is OK:usfuture
AWT-EventQueue-0 (16:32:55): Error id=-1 code=2104 msg=Market data farm connection is OK:eufarm
AWT-EventQueue-0 (16:32:55): Error id=-1 code=2104 msg=Market data farm connection is OK:usopt
AWT-EventQueue-0 (16:32:55): Error id=-1 code=2104 msg=Market data farm connection is OK:usfarm
AWT-EventQueue-0 (16:32:55): Error id=-1 code=2106 msg=HMDS data farm connection is OK:euhmds
AWT-EventQueue-0 (16:32:55): Error id=-1 code=2106 msg=HMDS data farm connection is OK:ushmds
AWT-EventQueue-0 (16:32:55): Error id=-1 code=2104 msg=Market data farm connection is OK:usfuture
AWT-EventQueue-0 (16:32:55): Error id=-1 code=2104 msg=Market data farm connection is OK:eufarm
AWT-EventQueue-0 (16:32:55): Error id=-1 code=2104 msg=Market data farm connection is OK:usopt
AWT-EventQueue-0 (16:32:55): Error id=-1 code=2104 msg=Market data farm connection is OK:usfarm
AWT-EventQueue-0 (16:32:55): Error id=-1 code=2106 msg=HMDS data farm connection is OK:euhmds
AWT-EventQueue-0 (16:32:55): Error id=-1 code=2106 msg=HMDS data farm connection is OK:ushmds
AWT-EventQueue-0 (16:32:55): Error id=1 code=10090 msg=Part of requested market data is not subscribed. Subscription-independent ticks are still active.Delayed market data is available.IBM NYSE/TOP/ALL

现在我没有收到任何价格!以下是调用本身的外观:

client().reqMarketDataType(3); //delayed prices
client().reqMktData(1,contract,"",true, null);

有什么想法吗?

这使用Ib_insync sdk 对我有用:

ib = IB()
ib.connect('127.0.0.1', 7497, clientId=1)
c = Contract(conId=292579214)
ib.qualifyContracts(c)
ib.reqMarketDataType(3)
ticker = ib.reqTickers(c)
print(ticker)
for obj in ticker:
print("--->{}<------".format(obj.ask))```

也许这会帮助其他人...

相关内容

  • 没有找到相关文章

最新更新