github.com/diadata-org/diadata@v1.4.593/documentation/methodology/digital-assets/exchangeprices/ma-moving-average.md (about)

     1  ---
     2  description: >-
     3    This section describes the use of the Moving AVerage methodology in the DIA
     4    filter system.
     5  ---
     6  
     7  # MA: Moving average
     8  
     9  The Moving Average filter is one of the most commonly used filters for price determination.
    10  
    11  ### Trade Collection
    12  
    13  All trades from the queried time range are ordered by timestamp.
    14  
    15  For each second in the time range, there exists a "slot" where trades are put into. 
    16  
    17  ### Price Calculation
    18  
    19  As soon as all going through all trades in the block has 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.
    20  
    21  The result is then returned as the result of the filter operation.
    22  
    23  ### Implementation
    24  
    25  The filter is implemented as part of the FiltersBlockService [in this file in our Github repository](../../../../internal/pkg/filtersBlockService/FilterMA.go).