orderid

Obtain next valid order identification number

Syntax

id = orderid(ib)

Description

example

id = orderid(ib) obtains the next valid order identification number for Interactive Brokers® connection ib.

Examples

collapse all

Create an IB Trader Workstation℠ connection on the local machine using port number 7496.

ib = ibtws('',7496);

Obtain the next valid order identification number using ib.

id = orderid(ib)
id =

     1

id contains the next valid order identification number. To create an order, use this number in createOrder.

Close the IB Trader Workstation℠ connection.

close(ib)

Input Arguments

collapse all

IB Trader Workstation connection, specified as an IB Trader Workstation connection object created using ibtws.

Output Arguments

collapse all

Next valid order identification number, returned as a numeric scalar.

Tips

If the variable ibBuiltInErrMsg appears in the MATLAB® workspace, check the status of the connection and function execution by displaying the contents of this variable. ibBuiltInErrMsg contains messages related to:

  • Connection

  • Information resulting from executing functions

  • Errors

Introduced in R2015a