Window Aggregate Python SequenceIterator Methods

Like Grid Aggregate methods, all Window Aggregate methods take an integer interval argument and produce a result sequence containing the calculated aggregate for each interval. The difference in how Window Aggregate methods determine their sliding window interval is described in the Window versus Grid Aggregate page. The result of all Window Aggregate methods is returned in the result sequence as the calculated aggregate for each interval. As with Grid Aggregate methods, the object's sequence is split into intervals based on the value of the interval argument (of type uint8) which determines the maximum number of elements in the group, though there may be fewer. So the input sequence will be divided into blocks of interval elements on which the operation is performed.

window_agg_max( interval ) Returns the sequence with the maximum value for each window of elements
window_agg_min( interval ) Returns the sequence with the minimum value for each window of elements
window_agg_sum( interval ) Returns the sequence with the sum of each window of elements
window_agg_avg( interval ) Returns the sequence with the average of each window of elements
window_agg_var( interval ) Returns the sequence with the variance of each window of elements
window_agg_var_samp( interval ) Returns the sequence with the sample variance of each window of elements
window_agg_dev( interval ) Returns the sequence with the standard deviation of each window of elements
window_agg_dev_samp( interval ) Returns the sequence with the sample standard deviation of each window of elements

Example

Following is an example code snippet demonstrating a window aggregate method:

         
    cursor = con.cursor("Quote", "by_sym")
    for quote in cursor:
        cl1,cl2 = quote.close.tee()
        avg5_it = cl1.window_agg_avg(5)
        avg20_it = cl2.window_agg_avg(20)
        ...