[R-SIG-Finance] problem placing order
Stephen Choularton
stephen at organicfoodmarkets.com.au
Wed Apr 27 03:17:46 CEST 2016
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:
> 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.
>>
>
> _______________________________________________
> 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