How do I create an algo on TT?

Hi i’ve asked a few questions previously related to TT and creating my own algorithm.

Can anyone care to explain how to begin this process or give me some advice? I see all of the blocks on the left side of my screen, but i’m not exactly sure what to do with them.

Hey @Nahama

Algos can get very in depth on this platform, not that it’s a bad thing, but it can be somewhat confusing for a first timer. I will try and explain as best as I can. A lot of the following information is directly from the TT site, but i’ll try to make it easier for you and post here.

The instructions below can be used to create an entry order that will place a 5 lot order at the best bid for the instrument you select in the instrument block.

1. From the Blocks panel, click and drag the Order block on the ADL canvas.

As far as I know, all entry algos must start with an order block. Once placed, the Order block will be highlighted yellow to indicate that it is the currently selected block. In the Block Properties panel, you can view and edit the properties for the highlighted block.

2. In the Blocks Properties panel, specify the following properties.

  • Specify a Name of Entry Order to make it easier to identify the block.
  • Set Type to Limit
  • Set Side is Buy
  • Set TIF is Day .

You should see the block name appear under the Order block in the canvas.

Now that you have an order block, you need to select an instrument you want to trade. The Instrument block lets you select the instrument you want to use. In this algo, you will select a default contract, the front-month e-Mini S&P on CME, but will also allow a user to choose a different contract when launching the algo.

To define the instrument for our entry order:

3. From the Blocks panel, double-click the Instrument block and then arrange it within the ADL canvas.

4. In the Block Properties panel, specify the following Properties.

  • Give the block a Name of Instrument .
  • In the Instrument field, specify the default instrument for the algo. In this example, you want to use CME’s front-month e-Mini S&P contract.
  • For the Type property, select User-defined which will allow the user to choose a different contract when launching the algo.
  • Select an Account in the SIM environment which has:
    • Been assigned to your login.
    • User permissions to run in ADL.
    • Account permissions to run in ADL.

You can now see the selected Instrument displayed next to the blue instrument output port.

To set the instrument for the entry order, connect the Instrument block to the the Entry Order block by clicking and dragging the left mouse button from the Instrument block’s output port to the Entry Order block’s inst input port.

Next, set the price of the entry order at the best bid for the selected instrument. This algo uses a Field block to receive instrument data from the Instrument block, continuously extract the Best Bid price of the instrument, and provide that value to the price port of our Entry Order block.

To place the Field block and make the necessary connections:

5. You can use the Search feature to simplify the process of locating and pre-populating blocks. From the Blocks panel Search field, type " bid ".Notice how the list of blocks in the panel includes only those blocks whose names or properties that contain the string, “bid.”

6. From the Blocks panel, click and drag the Field (bidPrice) block on to the ADL canvas.

7. In the Blocks Properties panel, specify the following properties.

  • Notice that the Field Name drop-down is already selected as the result of block search.
  • Set Name to Best Bid .
  • Ensure that the Lookup Type is Best .

8. To use Edge Finder to more easily connect blocks, press and hold the Shift key to display dashed lines for suggested connections from the Instrument block to the Field block and from the Field block to the price port of the Order block.

image

9. While holding the Shift key, either left-click each of the two dashed lines to make the connections, or right click one of the dotted lines to create both edges at once.

image

To define the entry order quantity, the algo uses a Number block. You will set a default value of 5, but allow the user to specify different quantities when running the algo.

To place the Number block and make the necessary connections:

10. From the Blocks panel Search field, type 5 .Notice how the panel automatically shows a Number block with its value already set to 5.

11. Click and drag the Number block on to the ADL canvas.

12. In the Blocks Properties panel, specify the following properties.

  • Notice that the Default Value drop-down is already set to 5, as the result of block search.
  • Set Name to Entry Order Qty .
  • Set Variable Type to User Defined which will allow the user to provide an order quantity other than the default of 5.
  • If desired, you could also use Max Value and Min Value to prevent users from accidentally submitting unreasonable order quantities.

13. Connect the Number block to the qty input port of the Order block.

image

After connecting the blocks, you have addressed the last of the problem issues, so the Problems tab is now blank.

This is how you create an entry order portion of your algo which will place a 5-lot order at the best bid for the instrument defined by the Instrument block.

1 Like

@FimeJB

Wow thanks for the help. I’ve been interested in creating Algos on TT for quite some time now, but wasn’t sure of the process. This definitely clears things up!

Seems like these algos can get quite in depth. Excited to see what we can muster up.

TT published a series of 5 videos, each running just a few minutes, to show how to build a basic scalping algo. Here’s a link to the series:

1 Like