网络上有没有使用 IBrokers软件包从 Interactive Brokers 下载数据时如何处理错误的示例?我已经查看了包裹的详细信息,eWrapper
并且twsCALLBACK
似乎可以处理这个问题,但我无法让它们工作。例如,下面的代码产生错误并且 R 挂起,错误消息未处理。感谢您的任何建议。
contract <- twsContract(0,
symbol="SPI",
sectype="XXX", #bad sectype
exch="SNFE",
primary="",
expiry= "20181220",
strike="",
currency="AUD",
right="",
local="",
multiplier = "25",
combo_legs_desc = "",
comboleg = "",
include_expired = "",
secIdType = "",
secId = "")
tws <- twsConnect()
data <- reqMktData(tws,contract,snapshot = TRUE)