Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/r/80.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
以TWS为单位与IBroker签订的货币(外汇)订单_R_Ibrokers - Fatal编程技术网

以TWS为单位与IBroker签订的货币(外汇)订单

以TWS为单位与IBroker签订的货币(外汇)订单,r,ibrokers,R,Ibrokers,我能够使用IBrokers通过API提交标准期货和股票订单。当我尝试spot FX的相同方法时,我没有收到错误消息,但订单不会像其他合同类型那样通过TWS工作窗口 contract = twsCurrency("EUR.USD") Order = twsOrder( reqIds(tws), action = "BUY", totalQuantity = 1000000, orderType = "LMT", lmtPrice = 1.0600 ) placeOrder(

我能够使用IBrokers通过API提交标准期货和股票订单。当我尝试spot FX的相同方法时,我没有收到错误消息,但订单不会像其他合同类型那样通过TWS工作窗口

contract = twsCurrency("EUR.USD")

Order = twsOrder(
  reqIds(tws),
  action = "BUY",
  totalQuantity = 1000000,
  orderType = "LMT",
  lmtPrice = 1.0600
)

placeOrder(tws, 
           Contract = contract, 
           Order)

最后的问题是数值
1000000
被转换为字符串。在这个过程中,转换首先被转换为科学符号,而TWS API不接受这种转换。要更正此问题,请设置
选项(scipen=12)
或在12处设置一些非常大的值