我尝试将TWS(Interactive Broker的交易应用程序)与R.中的测试脚本连接起来
library (IBrokers)
tws <- twsConnect()
aapl.csv <- file("AAPL.csv", open="w")
reqMktData (tws, twsSTK("AAPL"), eventWrapper = eWrapper.MktData.CSV(1), file = aapl.csv)
close(aapl.csv)
close(two)
我收到错误消息。我可以成功地从TWS检索历史数据"AAPL"。请告知这个程序出了什么问题。
2 -1 2104 Market data farm connection is OK:hfarm
2 -1 2104 Market data farm connection is OK:jfarm
2 -1 2104 Market data farm connection is OK:eufarm
2 -1 2104 Market data farm connection is OK:usfuture
2 -1 2104 Market data farm connection is OK:cashfarm
2 -1 2104 Market data farm connection is OK:usfarm.us
2 -1 2104 Market data farm connection is OK:usfarm
2 -1 2106 HMDS data farm connection is OK:ilhmds
2 -1 2106 HMDS data farm connection is OK:fundfarm
2 -1 2106 HMDS data farm connection is OK:ethmds
2 -1 2106 HMDS data farm connection is OK:ushmds
2 1 354 Requested market data is not subscribed.AAPL NASDAQ.NMS/TOP/ALL
谢谢。
纸质帐户上的订阅与实时帐户上的预订镜像。以下是一些可能导致该错误的因素:
1.您没有在您的实时账户上支付纳斯达克订阅费。
2.您的实时帐户当前正在使用订阅,您正在尝试请求纸质帐户上的数据。你不能两者都做。