The Discrete Min and Discrete Max blocks output the minimum and maximum values, respectively, of their internal numeric collections. Each time one of the blocks receives a discrete event message, it adds a user-specified numeric value to its internal collection of values and then outputs either the minimum or maximum values in the collection.
The blocks process discrete event messages as follows:
For example, suppose a Discrete Max block stores the value of the trade quantity from each incoming discrete event message from a Time and Sales block. As trades occurred, the Discrete Max block stored the values, [5, 10, 5, 25, 50, 10]. If the Discrete Max block receives its next message from the Time and Sales block with a trade quantity of 8, the block would output the value 50 because it represents the maximum value stored by the block. A Discrete Min block with the same values would return 5.
You can also set up the Discrete Min/Max block to delete its internal data collection and reset its output to NaN (Not A Number) when a discrete event message triggers the reset port.
Example Output minimum and maximum trade quantities in a five-second span
The Discrete Min and Discrete Max blocks would define the following formulas in the Formula Editor.
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. |