Below are the blocks and connections used in this tutorial.
To build this entry-exit order algo, you will use the following blocks.
This entry-exit algo uses two main trading blocks:
The Instrument block provides access to market data for contracts you want to trade using an ADL algo. This algo uses only one contract, so you will need to add one Instrument block.
The Order block submits buy or sell orders to an exchange. It specifies the order type, such as Limit or Market, and identifies the instrument, price and quantity through its input ports. For this algo, you will need to add two Order blocks, one for the entry Buy order and one for the exit Sell order.
Between the Instrument block and the Order block, you use other blocks that support the algo by extracting market data, specifying quantities, and accessing information from messages. This entry-exit algo uses the following supporting blocks:
The Field block lets you extract market data from an Instrument, such as prices and quantities, that you can then use in your algo. This algo uses two Field blocks to get the bid price for the Buy order and the ask price for the Sell order.
The Number block outputs a numerical value. This algo uses the Number block to set the order quantity to 1.
MsgInfo Extractor block
The MsgInfo Extractor block lets you extract information from a discrete event message generated by another block, such as an Order block. This algo uses a MsgInfo Extractor block to capture the quantity of the fill for the Buy order managed by the Buy Order block.
After placing the blocks needed for the algo, you need to connect the inputs and outputs of the blocks to indicate how data will flow through the algo and between blocks.