Ensure that TWS is running, and that you have entered your user name in the User Name field in the Which Trader Workstation? section of all pages in the Excel spreadsheet to properly connect to TWS.
To set up a conditional order
On the Conditional Orders page, first create the order you want transmitted when a condition is met by defining the contract in the Contract Description fields, and then using the Order Description area to set up the order parameters.
In the blue Condition Statements area, use the Statement field to set the criteria which must be met to trigger the order. When the Statement = TRUE, your order will be submitted.
The sample spreadsheet includes a pair of orders, with the second orders transmission depending on the first order being completely filled. In this case, the Statement field trigger is that the value in cell T10 (the Filled field) must be equal to the value in M10 (the order Quantity field).
Type ADD in the ADD/MOD field because you are creating a one-time order.
Define the remaining order parameters just as you did in the Order Description area.
Complete the necessary fields on the Conditional Orders page according to the syntax in the following table.
Field |
Description |
Statement |
An Excel function which returns a true or false. When true, the order will be submitted; when false, nothing happens. |
ADD/MOD |
Use ADD for a one-time order. Use MOD to continue checking and modifying the order until it is completely filled. This is the field that activates a conditional order, and orders will be activated only with the "ADD" or "MOD" tags. |
Action |
BUY SELL |
Quantity |
Enter the quantity of the order. |
Order Type |
Refer to list of supported order types. |
Lmt Price |
The limit price for Limit and Stop Limit order types. |
Aux. Price |
The stop-election price for Stop and Stop Limit order types, or the offset for relative orders. |
All of the fields described above may be variables that depend on other cells, so any type of conditional order may be created.