Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/r/73.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
使用iBroker进行期权交易_R_Options_Ibrokers - Fatal编程技术网

使用iBroker进行期权交易

使用iBroker进行期权交易,r,options,ibrokers,R,Options,Ibrokers,我可以使用R(使用)在交互式经纪人上进行股票交易,但我不能进行期权交易 我在这里发布我的示例代码,也许社区中的某个人可以提供帮助 library('IBrokers') tws <- twsConnect(port=7497) orderid = reqIds( tws, numIds=1) neworder = twsOrder( orderid, action='BUY', totalQuantity='4', orderType='LMT', lmtPrice='.1') opt

我可以使用R(使用)在交互式经纪人上进行股票交易,但我不能进行期权交易

我在这里发布我的示例代码,也许社区中的某个人可以提供帮助

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)
library('IBrokers'))

tws如果您没有填写正确的过期日期,您应该尝试:

opt <- twsOption("AAPL", expiry="20180315", strike="170", right="C")

opt即使我尝试了这个,仍然没有成功:ibrary('IBrokers')tws