IBROKER - Problems with OrderID

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

IBROKER - Problems with OrderID

Martin Bauer
Hi,
 
here my code
 
require(IBrokers)
tws=twsConnect(clientId = 22)
reqCurrentTime(tws)
serverVersion(tws)
isConnected(tws)
order=twsOrder(orderId=reqIds(tws),clientId = 22,totalQuantity=1,orderType="MOC",action="BUY")
placeOrder(tws,twsSTK("SPY"),order)
 
OUTPUT
 
TWS Message: 2 -1 2104 Market data farm connection is OK:usfuture 
TWS Message: 2 -1 2104 Market data farm connection is OK:eurofarm 
TWS Message: 2 -1 2104 Market data farm connection is OK:cashfarm 
TWS Message: 2 -1 2104 Market data farm connection is OK:usfarm.us 
TWS Message: 2 -1 2104 Market data farm connection is OK:usfarm 
[1] "2013-07-10 12:47:41 CEST"
> serverVersion(tws)
[1] "67"
> isConnected(tws)
[1] TRUE
> orderId=reqIds(tws)
Warnmeldung:
In reqIds(tws) : NAs durch Umwandlung erzeugt
> orderId2=reqIds(tws)
> orderId3=reqIds(tws)
> orderId4=reqIds(tws)
 
 
 
My problem I receive no valid orderId
When I try the first request - the orderid equals my Accountnumber
the 2nd orderid request ends with "NA_CHARACTER_" same for all the followings
 
Any idea
Many thanks
 
Best Regards
Martin
 
 

_______________________________________________
[hidden email] 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.
Reply | Threaded
Open this post in threaded view
|

Re: IBROKER - Problems with OrderID

Jeffrey Ryan
Can you tell me what version of IBrokers you are using?  

Jeffrey Ryan    |    Founder    |    [hidden email]

www.lemnica.com

On Jul 10, 2013, at 5:53 AM, "Martin Bauer" <[hidden email]> wrote:

> Hi,
>  
> here my code
>  
> require(IBrokers)
> tws=twsConnect(clientId = 22)
> reqCurrentTime(tws)
> serverVersion(tws)
> isConnected(tws)
> order=twsOrder(orderId=reqIds(tws),clientId = 22,totalQuantity=1,orderType="MOC",action="BUY")
> placeOrder(tws,twsSTK("SPY"),order)
>  
> OUTPUT
>  
> TWS Message: 2 -1 2104 Market data farm connection is OK:usfuture
> TWS Message: 2 -1 2104 Market data farm connection is OK:eurofarm
> TWS Message: 2 -1 2104 Market data farm connection is OK:cashfarm
> TWS Message: 2 -1 2104 Market data farm connection is OK:usfarm.us
> TWS Message: 2 -1 2104 Market data farm connection is OK:usfarm
> [1] "2013-07-10 12:47:41 CEST"
> > serverVersion(tws)
> [1] "67"
> > isConnected(tws)
> [1] TRUE
> > orderId=reqIds(tws)
> Warnmeldung:
> In reqIds(tws) : NAs durch Umwandlung erzeugt
> > orderId2=reqIds(tws)
> > orderId3=reqIds(tws)
> > orderId4=reqIds(tws)
>  
>  
>  
> My problem I receive no valid orderId
> When I try the first request - the orderid equals my Accountnumber
> the 2nd orderid request ends with "NA_CHARACTER_" same for all the followings
>  
> Any idea
> Many thanks
>  
> Best Regards
> Martin
>  
>  
> _______________________________________________
> [hidden email] 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.

        [[alternative HTML version deleted]]

_______________________________________________
[hidden email] 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.