Description Usage Arguments Details Value Note Author(s) References See Also Examples
Place or cancel an order to the TWS.
1 2 3 | placeOrder(twsconn, Contract, Order)
cancelOrder(twsconn, orderId)
|
twsconn |
A twsConnection object. |
Contract |
A twsContract object. |
Order |
A twsOrder object. |
orderId |
A valid order id. |
As described by the official Interactive Brokers (tm) documentation. Caveat Emptor!!
Called for its side effect of placing or cancelling an order on the TWS. This also returns the orderId used for placeOrder. An additional side-effect is that a variable .Last.orderId will be created or updated in the GlobalEnv as well.
Orders via the API are quite complicated, or at least can be. It is strongly advised to only proceed with trading real money after one understands not only all the R code in this package, but the official API as well. If you are more comfortable clicking shiny buttons in a GUI, it is probably better that you keep clicking the buttons and not pretend to program.
Not for the faint of heart. All profits and losses related are yours and yours alone. If you don't like it, write it yourself.
Jeffrey A. Ryan
Official Place Order API: http://www.interactivebrokers.com/php/apiUsersGuide/apiguide/java/placeorder.htm
1 2 3 4 5 6 7 8 | ## Not run:
tws <- twsConnect()
id <- reqIds(tws)
placeOrder(tws, twsSTK("AAPL"), twsOrder(id))
cancelOrder(id)
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.