The Value Accumulator Block accumulates a user-specified numeric value when it is triggered by a discrete event message. After calculating the accumulated value, the block outputs both the accumulated value and the original input discrete event event message. You can also attach another discrete event message to the reset input port to reset the block value to 0.
You use the Formula Builder for the block to specify the value to accumulate. You can use the value of a field in the message or create a formula that generates a numeric value. For example, if you want accumulate the fill quantity for each fill message attached to the block, you could use the following formula.
In addition to accumulating selected information, such as fill quantity, the Value Accumulator Block can also be used as a counter to count the occurrence of a user-defined market event. In the Formula Builder, drag and drop the "#" icon onto the canvas and input the value "1". With this setup, the Value Accumulator will accumulate the numeric value "1" for each occurrence of the event.
Example Disable the Order block when the number of fills reaches three
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|