ADL®

Instrument Block

The Instrument Block identifies an exchange-traded or synthetic instrument to use in an algorithm. The output from the Instrument Block can be connected to other blocks, such as Order Blocks 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 Connect Instrument Block to other blocks.

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 is executable directly from an MD Trader widget. The instrument automatically matches the instrument shown on the ladder.

Block settings

To change default block settings, double-click the block to open the Block Editor.

Setting Description
Name Name to display beneath the block on the ADL canvas
BodyColor Background color of the block
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.
  • UserDefined. 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.
  • OrderInstrument. Any algorithm containing an Order Instrument will be recognized as an Order Ticket Algorithm (OTA), which is executable directly from an MD Trader widget. The instrument automatically matches the instrument shown on the ladder.

You can also use the right-click context menu to set or change the method.

Account

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

Description Optional text to explain how the block is used