I am aware that you can synthetically create a trailing stop order by constantly updating stop orders in handle_data. This has the three main disadvantages:
- The extra calculations and steps increase complexity and can be costly when your minutely handle_data is already pushing the limits.
- Extra code makes it difficult for newer users who want to use the trailing stop order, which is one of the most common complex order types. Whereas it would be very user-friendly to have it neatly wrapped in a function native to IB.
- Clogs up your orders and fills dashboard in live trading with a bunch of cancelled stop orders. This is especially true when the stock has a .05 tick and the stop needs to be resubmitted in the next minute with a .05 rounded value--this can be resolved with a datastore of stocks with .05 ticks after the first failed submission of each stock, but this further aggravates reason #1.
In the IB API, you will notice that trailing stop loss orders are supported as shown in the below documentation. May Quantopian please wrap the trailing stop loss order into an actual order type?