[R-SIG-Finance] problem placing order
Stephen Choularton
stephen at organicfoodmarkets.com.au
Tue Apr 26 21:36:22 CEST 2016
Hi
I wonder if someone can see what I am doing wrong.
library(IBrokers)
tws <- twsConnect()
sym <- "WBC"
contract <-twsEquity(sym, exch='ASX', currency='AUD')
# these work
price <- reqMktData(tws, contract, snapshot="TRUE")
price$Close
size <- 1000
order <- twsOrder(reqIds(tws), 'BUY', size, 'MKT')
#this doesn't produce an order in the tws
placeOrder(tws, contract, order)
closeAllConnections()
reqMktData works but placeOrder does not.
-----------------------------------------------------------------------------------------------------------------------------------
Stephen Choularton PhD, FIoD
0413 545 182
More information about the R-SIG-Finance
mailing list