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:
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.
To customize the block, update the Block Properties.
|Name||Name to display beneath the block on the ADL canvas|
Equation used to calculate the value of the block
The edit link opens the Formula Editor.