Building your first algo

Building your first algo

Your algo's purpose

When creating an ADL algo, you first need to define the purpose for the algo; then you determine which blocks you need to build it.

Suppose you want to create an algo that attempts to buy 5 contracts of Jun 2017 E-Mini S&P 500 futures (ES) for the best bid price; then when the order is filled, it attempts to sell those contracts at the best offer price. (Note that the strategy would be slightly more complex in practice, but the example has been simplified for the sake of illustration).

To help you get a basic understanding of how to create an ADL algo, you will create this basic entry-exit order algo. When the algo starts, it will submit a five-lot Buy order to enter the market. As the entry order is filled, the algo submits correpsonding Sell orders matching the fill quantity to exit the market and offset your position.

Entry Exit Algo

You will build the algo using the following sequence:

  1. Open ADL.
  2. Choose the instrument you want trade.
  3. Create the logic for your entry order.
  4. Create the logic for your exit order.
  5. Test the algo to verity it works as expected.