我尝试使用函数 reqExecutions 从 IB 查询交易:
library(IBrokers)
con <- twsConnect(clientId=1)
id <- reqIds(con)
Order <- twsOrder(orderId=id, action="BUY", totalQuantity = 1, orderType="LMT", lmtPrice = 600, tif="GTC")
placeOrder(con, twsSTK("AAPL", Order)
print(reqExecutions(con, reqId = as.character(.Last.orderId), ExecutionFilter = twsExecutionFilter(clientId="1")))
尽管交易是在 IB 中执行的,但它总是返回 NULL。