Trading Blocks

Trading Blocks

Instrument block

The Instrument block is a trading block that identifies an exchange-traded or synthetic instrument to use in an algorithm. It allows your algo to access market data and activity associated with the instrument. You connect the output from the Instrument block to other trading blocks, such as Order and Field blocks, that need access to an instrument's ID or market data.

The following example shows how an Instrument block can connect to an Order block to submit an order, a Field block to retrieve the bid price, and a Market State block to determine whether the market is open.

Example The Instrument block has an instrument identified in its properties and passes that instrument's market data to upstream blocks.

  1. Order block to specify the instrument
  2. Field block to extract market data for the instrument
  3. Market State block to determine the current status of the market on which the instrument trades

To provide flexibility and reuse for algorithms, ADL allows you to specify instruments in three different ways:

  • Static. The instrument is set during development and does not change during execution.
  • User-defined. The instrument can be set or changed before starting an algorithm. This option allows you to design an algorithm template that can be used with different instruments.
  • Order instrument. Any algorithm containing an Order Instrument will be recognized as an Order Ticket Algorithm (OTA), which can be executed directly from an MD Trader widget. The instrument automatically matches the instrument shown on the ladder.

Block properties

To customize the block, update the Block Properties.

Property Description
Name Name to display beneath the block on the ADL canvas
Instrument

Default instrument to attach to the block

You can begin typing to search for an instrument, or you can use the instrument explorer to identify the instrument.

Type

Method to use to specify the instrument

  • Static. The instrument is set during development and does not change during execution.
  • User Defined. The instrument can be set or changed before starting an algorithm. This option allows you to design an algorithm template that can be used with different instruments.
  • Order Instrument. The instrument automatically matches the instrument shown on the ladder in the MD Trader widget.
Account

Account to use for accessing the market data and for routing orders