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
To change default block settings, double-click the block to open the Block Editor.
|Name||Name to display beneath the block on the ADL canvas|
|BodyColor||Background color of the block|
Equation used to calculate the value of the block
If not yet defined, the field displays a Click to edit formula link that opens the Formula Builder.
|Description||Optional text to explain how the block is used|