我尝试将 TWS(盈透证券的交易应用程序)与 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
谢谢你。