All Grid Aggregate C++ Sequence methods take an integer interval argument and produce a result sequence containing the calculated aggregate for each interval.
Sequence<T> gridAggMax(mco_size_t interval) const Returns the result sequence of the same TYPE
with the maximum value for each interval of elementsSequence<T> gridAggMin(mco_size_t interval) const Returns the result sequence of the same TYPE
with the minimum value for each interval of elementsSequence<R> gridAggSum(mco_size_t interval) const Returns the result sequence of the same TYPE
with the sum of each interval of elementsSequence<double> gridAggAvg(mco_size_t interval) const Returns the double
result sequence with the average of each interval of elementsSequence<double> gridAggVar(mco_size_t interval) const Returns the double
result sequence with the variance of each interval of elementsSequence<double> gridAggVarSamp(mco_size_t interval) const Returns the double
result sequence with the sample variance of each interval of elementsSequence<double> gridAggDev(mco_size_t interval) const Returns the double
result sequence with the standard deviation of each interval of elementsSequence<double> gridAggDevSamp(mco_size_t interval) const Returns the double
result sequence with the sample standard deviation of each interval of elementsExample
Following is an example code snippet demonstrating a grid aggregate method:
{ mco_trans_h trans; mco_cursor_t quote_cursor; Quote quote; MCO_RET rc; ... rc = mco_trans_start(db, MCO_READ_ONLY, MCO_TRANS_FOREGROUND, &trans); if ( MCO_S_OK == rc ) { for (rc = mco_cursor_first(trans, "e_cursor); rc != MCO_S_CURSOR_END; rc = mco_cursor_next(trans, "e_cursor)) { quote.from.cursor(trans, "e_cursor); // Calculate the maximmum close price for each week print_sequence(quote, quote.close_iterator().gridAggMax(7)); } mco_trans_rollback(trans); } }