The Moving Average Block maintains an internal collection of numeric values (such as LTP) and outputs the average of the most recent user-specified number of values (#Bars). The block conceptually creates a new bar for a chart. Every time the block receives a message on its Intervals port, it performs the following actions:
Optionally, you can also configure the following ports:
Ready: This port can be used to determine whether the block has collected sufficient number of bars to satisfy the [#bars] input. If the block does not have sufficient number of bars, the Ready port will output False. When the block accumulates sufficient number of bars, the Ready port will output TRUE.
Reset: This port can be used to force the Moving Average Block to delete its internal data collection and reset the Avg to a NaN (Not A Number) when a discrete event message triggers the reset port.
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|