Learn R Programming

IBrokers (version 0.10-2)

.placeOrder: TWS Orders

Description

Place or cancel an order to the TWS.

Usage

placeOrder(twsconn, Contract, Order)

cancelOrder(twsconn, orderId)

Value

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.

Arguments

twsconn

A twsConnection object.

Contract

A twsContract object.

Order

A twsOrder object.

orderId

A valid order id.

Author

Jeffrey A. Ryan

Details

As described by the official Interactive Brokers (tm) documentation. Caveat Emptor!!

References

Official Place Order API: https://interactivebrokers.github.io/tws-api/classIBApi_1_1EClient.html#aa6ff6f6455c551bef9d66c34d1c8586c

See Also

twsContract twsOrder reqIds

Examples

Run this code
if (FALSE) {
tws <- twsConnect()
id <- reqIds(tws)

placeOrder(tws, twsSTK("AAPL"), twsOrder(id))
cancelOrder(tws, id)
}

Run the code above in your browser using DataLab