ADL®

User-Defined Variables

Designating a block as a variable allows the user to alter the output value of the block while the algorithm is running. In addition, some variable blocks can be linked to Microsoft Office Excel allowing the user to alter the block's value directly through the Excel sheet (see: DDE Functionality for more information).

The following blocks can be designated as a user-defined variable:

  • Boolean Block
  • Instrument Block
  • Number Block
  • Price Block

Note The value of a user-defined Instrument Block cannot be altered while the algorithm is running; it must be set prior to the launch of the algorithm.

When a block is designated as a user-defined variable, its information appears as a new entry in the Variables Tab of the Information Panel, allowing the user to reconfigure the name, value, type, and the description of the variable.

How to designate a block as a variable

Right-click on the block to display types of variables available for the respective block. If you select a variable type, a check mark will appear to the left of the selected variable type, indicating that the block has been designated as a variable.

Example Designating a Number Block as a user-defined variable

Using the Variable tab

The Variables Tab in the Information panel lets you quickly view and reconfigure the following aspects of a variable:

  • Block: The name of the variable as it appears on the Designer canvas as well as on any location from which the algorithm can be launched (e.g., Algo Dashboard).

  • Default Value: The value of the variable. By default, this field is set to the value assigned by the user on the Designer canvas.

  • Value Type: The method by which the user assigns the value of the variable, as follows:

    • UserDefined: When this option is selected, the value of the variable can be assigned through the Algo Dashboard.
    • OrderInstrument: (Available only for the Instrument Block) To understand this functionality please view Creating and Launching Order Ticket Algorithms (OTAs). When this option is selected, the value of the Instrument Block is set to the instrument specified on the MD Trader window.
    • OrderPrice: (Available only for the Constant Number Block and Price Block) To understand this functionality please view Creating and Launching Order Management Algorithms (OMAs). When this option is selected, the value of the Constant Number Block is set to the price specified by the user directly on the MD Trader® widget.
    • OrderQty: (Available only for the Constant Number Block) To understand this functionality please view Creating and Launching Order Ticket Algorithms (OTAs). When this option is selected, the value of the Constant Number Block is set to the quantity specified by the user directly on the MD Trader® widget.
    • OrderSide: Available only for the Boolean Block. When this option is selected, the value of the Boolean Block becomes tied to the Order Side variable. For instance, if the value of the Boolean Block was set to True when Order Side is “Buy,” the block will reverse its value to False when the Order Side is “Sell.”
  • Description: Text description of the variable. This information will not be used or displayed elsewhere.

Note Variables can be rearranged using the drag-and-drop method. After deployment, the order of the variables is reflected within the Algo Dashboard widget.