Discrete blocks

Discrete blocks

Value Extractor block

The Value Extractor block is commonly used to take a snapshot of information that may be constantly changing in the market, such as the last-traded quantity of a given instrument. By taking a snapshot, the algo can capture the information at a single moment in time and use the "frozen" information later on even if the market continues to change. However, when a new discrete event message triggers the Value Extractor block, the block will replace the old snapshot with a new one.

The Value Extractor block works as follows:

  1. A incoming discrete event message triggers the Value Extractor block.
  2. When triggered, the Value Extractor block takes a "snapshot" of the desired information. You can choose to take a snapshot of information contained within the input message or of information unrelated to the message.
  3. After the taking the snapshot, the Value Extractor block passes the input message unchanged through its lower-right port and starts to output the snapshot through the upper-right port.

    As indicated by the yellow output port, the value can be a Numeric, True/False or an Instrument type depending on the type of information captured by the snapshot.

Example Create a formula to extract the quantity of the last trade from the discrete event message

The Value Extractor block can also be used as a "toggle" to indicate the occurrence of a specific event in the market. To do this, the user can instruct a Value Extractor block to take a snapshot of the numeric value "1" (in the internal logic canvas, type the value "1") when triggered by a discrete event message. Before the discrete event message occurs, the Value Extractor block will output the default value of zero. However, when the discrete event message occurs, the Value Extractor block will output a value of 1, indicating that the discrete event has occurred.

Block properties

To customize the block, update the Block Properties.

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

Equation used to calculate the value of the block

The edit link opens the Formula Editor.