Skip to content

problem placing order

3 messages · Stephen Choularton

#
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
#
Hi

Apologies - turned out to be to do with my settings.  Looks like the 
code is right.


----------------------------------------------------------------------------------------------------------------------------------- 

Stephen Choularton PhD, FIoD
0413 545 182
On 27/04/2016 5:36 AM, Stephen Choularton wrote:
#
Further apologies - I have been asked to specify the problem/solution 
and I'm rather embarrassed to say it was because I had the order box set 
to transactions and I was trying to run the code before the exchange was 
open ;-(

Just proves having a Computing Science PhD doesn't stop you getting lost 
in all of this.

Thanks.
----------------------------------------------------------------------------------------------------------------------------------- 

Stephen Choularton PhD, FIoD
0413 545 182
On 27/04/2016 10:06 AM, Stephen Choularton wrote: