[R-SIG-Finance] problem placing order
Stephen Choularton
stephen at organicfoodmarkets.com.au
Wed Apr 27 02:06:22 CEST 2016
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:
> 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
>
> _______________________________________________
> R-SIG-Finance at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-sig-finance
> -- Subscriber-posting only. If you want to post, subscribe first.
> -- Also note that this is not the r-help list where general R
> questions should go.
>
More information about the R-SIG-Finance
mailing list