Robot Order Examples

There are a variety of orders that you can tell the robot to submit with each signal received from a certain strategy.

The only mandatory order is the entry order - every other order type is optional (although recommended!)

Other order types include:

  • Stop loss order
  • Time stop order
  • Trailing stop order
  • Target order

If you choose to use these additional order types, they are entered into TWS as "OCA" orders or "One Cancels All". This means that if any order fills (besides the entry order), then all the other orders in the batch are automatically canceled.

The Entry Order

The entry order can be one of these types:

  • Market Order - standard market order.  Use market orders for entry with caution.
  • Limit Order - standard limit order.  You can use the Last Price, Bid/Ask, or the Percent of Spread as a reference for the limit price.
  • Relative Order - similar to the limit order, but is quite a bit smarter as it can adjust automatically as the Bid/Ask changes.  Learn more.
  • Market On Open Order - MOO order which must be submitted by 9:28 ET.  This order is fully filled on the open.  Learn more.

If you choose Limit or Relative for the entry order type, you'll need to fill in the Limit Reference, the Limit Offset value and the Good for Seconds value.

Limit Reference - the limit reference tells the robot what reference point to use for your limit price.  Can be last price, bid/ask, or Percent of Spread.

Limit Offset - the limit offset tells the robot to put the limit order in at this amount of dollars away from the current price. This amount can be a negative value.

This value works the same way for long and short orders. For example, if you were trying to get "price improvement" for either a long or short strategy, you would put a negative number in the Limit Offset which would put your limit price "outside the market".

Good for Seconds - this is the number of seconds that the order is good for. If the entry order isn't filled during this time, the entry order and all attached orders are automatically canceled.

Stop Loss Order

The stop loss serves as your initial stop loss. This order goes in as a stop order and you can use the parameters to determine how far the stop is from your entry point.

There are four types of stop loss for the robot:

  • Percent Away from Signal Price
  • Dollars Away from Signal Price
  • Volatility Based
  • Wiggle Based

For the Percent and Dollars based stop loss, you'll need to fill in the Stop Offset field. If you choose Percent Away from Signal Price, the Stop Offset field will be interpreted as a percent. If you choose Dollars Away from Signal Price, the Stop Offset field will be interpreted as a dollar amount.

For the Volatility Based and Wiggle Based stop loss, you'll fill in a ratio and floor value for each.

The ratio value gets multiplied by the volatility or wiggle value to get the stop distance. For example, let's say you choose Volatility Based stop loss and a signal comes in that has a volatility of 0.25. If you've chosen 2 for the volatility ratio, the stop loss distance will be 0.25 * 2 = 0.50 away from the signal price.

The floor value lets you set a minimum amount that will be used for the volatility or wiggle. Sometimes the volatility or wiggle for a signal will be very small which, if you're using Risk Based on Stop Loss position sizing method, could cause the robot to buy a very large number of shares.

The floor value lets you control this by telling the robot to use at least the floor amount for the volatility or wiggle.

Continuing our previous example, let's say you used 2 for the volatility ratio and 0.20 for the volatility floor. If you received a signal that had a volatility of 0.25, then the stop distance would be 0.25 * 2 = 0.50 (the same as above).

However, if the signal had a volatility of 0.10 which is less than the volatility floor you specified, then the stop distance would be 0.20 * 2 = 0.40.

Time Stop Orders

The time stop order is a market order with a "Good After Time" value attached to it.

There are two types of time stop orders:

  • Seconds After Signal
  • Specific Time of Day

For the Seconds After Signal type, fill in the Seconds field and optionally the Or this time at the latest field.

For the Specific Time of Day type you specify a time of day (local time on your computer) and optionally add an integer for the number of days to add.

For example, if you wanted the time stop to activate the order at tomorrow's market open and your computer is in Eastern Time, you'd use 9:30:00 for the time field and 1 in the + this many days field.

Trailing Stop Orders

Trailing stop orders work exactly the same way as Stop Loss orders except they trail the price instead of staying fixed. Also note that the trailing stop order is completely unrelated to the stop loss, so you could have a trailing stop that is much looser than your stop loss.

Target Orders

The target order puts a limit order in the market that will be triggered when your trade goes in your direction (down for shorts, up for longs) by the amount you specify.

The same options are available for "sizing" the target distance as are available for the Stop Loss order type spelled out above.

Scaling Out

There is a new option within the Target section called "Use Scale Out".  This option allows you to exit portions of your original position at certain price levels as they are reached.  See image below.

scale out config

Alert Exit and Trend Exit

There are two advanced exit types based on Trade-Ideas alerts:

  • Alert Exit - use a Trade-Ideas strategy that will trigger an exit for a particular symbol when a signal is received for a symbol that has been traded within this strategy
  • Trend Exit - use a Trade-Ideas strategy that will trigger an exit for every position the strategy has taken when a signal is received for a symbol you specify.

alert exits