Political, Economic and Climate Forecast Contracts Are Live -
Client Login | View Markets | Learn More

TWS Accumulate/Distribute Algo


W E B I N A R    N O T E S

The initial intention was to develop an algorithm that would allow the trading of large blocks of stock without being detected in the market. As we went along, the algo evolved into much more, so that in its current state it can even be set up for high frequency trading.

Please keep in mind that the algo can be deployed for futures, options, forex or any product you can trade with us, and it can also be used to trade and allocate the resulting positions among multiple accounts.

 

Define the Algo

Let’s start with a simple task of say buying 1,000,000 shares of IBKR. (Selling works the same way as buying but I will demonstrate everything from the buying perspective).

We want to issue orders in 500 share increments every 30 seconds. If we can keep to that schedule, we would buy the 1 million shares in about three days. A 500 share buy order every 30 seconds would of course be immediately detected, and front ran --so we need to randomize these orders.

We can check randomize time and size.

 

Order Types

The order can be a Limit, Market or Relative order.

Note - Relative orders are not supported for products where cancellation fees are levied by the listing exchange.

Market - There is not much to say about a market order, it is issued at the ask price and you would use it only in case of some extremely liquid stock, where there is usually a penny wide market and large size on both sides.

Limit and Relative orders are much more interesting.

When you put in a relative order you must name what it is relative to, and here you have a lot of choices. Of course, if it is relative to a fixed value than it is really a limit order, but you can make it relative to the prevailing bid or the ask or the last price or VWAP or moving VWAP or moving average or EXP MVG, or your last trade price or the number of shares you have bought so far.

You also must input an offset to the item your order is relative to. Say you want to match the prevailing bid, than you put in BID and an offset of zero.

If you want to be aggressive,

We won’t go through all the various combinations of values you can put in here.

The next question is if you want to wait for the current order to be filled before the next order is submitted.

 

Conditions

Now we come to additional conditions you can pose. Whenever these conditions are not met, the algo can stop permanently or resume when they are satisfied again. Keep in mind that the algo is intended to be able to run unattended as one trader may be running several hundred of them at the same time.


Note - The best way to learn is to experiment with putting in various parameters without actually starting the algorithm.


Or you want the same condition to prevail for the IAI, which is a security brokers’ ETF containing IBKR. In that case you would put in the symbol IAI.


You are also free to compare two different things like IAI to SPY and make that into a condition.

Lastly, you can require that two relative measures be at least some fixed amount apart, higher or lower from each other. You can say that you want IBKR current price vs. its 10 day VWAP to be 2.1% lower than IAI current price vs. its 12 day VWAP.


In addition to moving large blocks of stock through this algo one can implement many different trading strategies by running an algo on the buy side and running one on the sell side at the same time.

To fully appreciate the power of the algorithm and how one trader can in fact do the work of ten or more by using it, you should try to put in hypothetical values for the variables and imagine what it would do. After you got a bit more comfortable with that, you could pick a low priced stock and do some live experiments with small sizes.



It is important to note that you can stop the algo at any time, or you can change any of the parameters while the algorithm is active. These changes however will not become effective until you click on the {apply} button.

If you become a frequent user of Accumulate / Distribute, you will not want to fill out a new template for each occasion from scratch. For this reason we are developing the ability to name your templates and to copy them for different symbols.


Monitor the Order Progress

The order Summary section for each algo provides real-time data so you can monitor the progress of the order.

The AccumDist Summary tab displays order management lines for all of your Accumulate/Distribute algos -- allowing a single trader to effectively manage multiple orders simultaneously.


Algo in progress: