|
Hi,
When placing an order via IBrokers, how do we know if it filled? Additionally, if it is a market order, how do we know what price it filled at? Along the same lines, is there a proper structure for placing an OCA order (where one or more stop limit orders are placed simultaneously with the opening order.) Currently, I place an order this way: orderID <- reqIds(tws) order <- twsOrder(orderID, action="BUY", totalQuantity="1", orderType = "MKT") myOrder <- placeOrder(tws, contract, order) cat(orderID, " ", price, "LONG-OPEN", "\n") Thank You, -- Noah Silverman UCLA Department of Statistics 8208 Math Sciences Building Los Angeles, CA 90095 _______________________________________________ [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. |
|
Dear Noah
one way to find out if your order was filled (and how much of it, and at what price) is to use reqExecutions(). It is documented in the IB API reference guide. The 'IBrokers' package implements it as a function, so you can look at it's source there. An example of how to read execution data from IB, albeit not in an easy on-liner, you can find in my 'qsiblive' paper trading demo which can be downloaded from my site http://censix.com . You should have a look at the files IBexecuteStrategy-eod.r IBplaceOrders.r IBorderFill.r in the 'source' directory. Specifying OCA groups can be done easily if you have a look at the sourcecode for placeOrder() in the 'IBrokers' package plus, again the IB API refernce guide. (don't remember the link now. Just google it) Cheers Soren On Mon, 16 Apr 2012 11:50:10 -0700 Noah Silverman <[hidden email]> wrote: > Hi, > > When placing an order via IBrokers, how do we know if it filled? > Additionally, if it is a market order, how do we know what price it > filled at? > > Along the same lines, is there a proper structure for placing an OCA > order (where one or more stop limit orders are placed simultaneously > with the opening order.) > > Currently, I place an order this way: > orderID <- reqIds(tws) > order <- twsOrder(orderID, action="BUY", totalQuantity="1", orderType > = "MKT") myOrder <- placeOrder(tws, contract, order) > cat(orderID, " ", price, "LONG-OPEN", "\n") > > > Thank You, > > > -- > Noah Silverman > UCLA Department of Statistics > 8208 Math Sciences Building > Los Angeles, CA 90095 > > _______________________________________________ > [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. -- http://censix.com _______________________________________________ [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. |
| Powered by Nabble | Edit this page |
