【发布时间】:2017-07-23 02:44:58
【问题描述】:
我可以使用 R(使用 IBrokers API)在 Interactive Brokers 上进行股票交易,但是对于期权交易我不能这样做。
我在这里发布我的示例代码,也许社区中的某个人可以提供帮助。
library('IBrokers')
tws <- twsConnect(port=7497)
orderid = reqIds( tws, numIds=1)
neworder = twsOrder( orderid, action='BUY', totalQuantity='4', orderType='LMT', lmtPrice='.1')
opt <- twsOption("AAPL",expiry="281707", strike="10.0", right="C")
placeOrder( tws, opt, neworder )
twsDisconnect(tws)
【问题讨论】:
-
即使我尝试了这个,仍然没有运气: ibrary('IBrokers') tws