MA: Moving average
This section describes the use of the Moving Average methodology in the DIA filter system.
The Moving Average filter is one of the most commonly used filters for price determination.

Trade Collection

All trades from the queried time range are ordered by timestamp.
For each second in the time range, there exists a "slot" where trades are put into.

Price Calculation

As soon as all trades in the block have been finalized, the simple average of these prices is calculated. This is done by accumulating prices and then dividing by the number of involved trades in this calculation.
The result is then returned as the result of the filter operation.

Implementation

The filter is implemented as part of the FiltersBlockService in this file in our Github repository.
Copy link
On this page
Trade Collection
Price Calculation
Implementation