[R-SIG-Finance] Placing Combo orders with IBrokers

psmith preston.c.smith at gmail.com
Tue Aug 9 02:15:48 CEST 2011


If anyone has successfully placed a combination order with the IBrokers
package, I'd appreciate it if you could post an example.  I have tried the
code below but although there are no errors, there is no order in TWS.  Also
if I follow this with a reqCurrentTime(tws), I get a bunch of warnings of
the type:

Warning: Unknown incoming message: °'. Please reset connection
Warning: Unknown incoming message: °›õ. Please reset connection

Thanks for any insight.

require(IBrokers)
tws <- twsConnect(1)
order <- twsOrder( orderId=reqIds(tws), totalQuantity = "1",  lmtPrice = "1"
) 
bag <- twsBAG(
  list(
    twsComboLeg(
      conId = "79265697", 
      ratio = "1", 
      action = "BUY", 
      exchange = "SMART"
    )
    ,
    twsComboLeg(
      conId = "79265687", 
      ratio = "1", 
      action = "SELL", 
      exchange = "SMART"
    )
  )
)
placeOrder( tws, bag, order)

--
View this message in context: http://r.789695.n4.nabble.com/Placing-Combo-orders-with-IBrokers-tp3728669p3728669.html
Sent from the Rmetrics mailing list archive at Nabble.com.



More information about the R-SIG-Finance mailing list