Grid aggregate methods split the source sequence into fixed-size blocks and calculate one aggregate value per block.
In the C# API, analytics operate on
Sequencevalues obtained fromOrderedSequence<T>searches, direct ordered-sequence iteration,UnorderedSequence<T>.All, or positional projections such asquote.Close[dayRange].For an overview see page The C# Sequence Class
Operations
source.GridAggMax(int interval)Maximum value per fixed-size block.source.GridAggMin(int interval)Minimum value per fixed-size block.source.GridAggSum(int interval)Sum per block.source.GridAggAvg(int interval)Average per block.source.GridAggVar(int interval)Variance per block.source.GridAggVarSamp(int interval)Sample variance per block.source.GridAggDev(int interval)Standard deviation per block.source.GridAggDevSamp(int interval)Sample standard deviation per block.Example
This example calculates the weekly maximum close price for each quote.
using (Sequence weeklyMax = quote.Close.All.GridAggMax(7)) { PrintFloatSequence(quote, weeklyMax); }