ASE Home Page Products Download Purchase Support About ASE
ChartDirector Support
Forum HomeForum Home   SearchSearch

Message ListMessage List     Post MessagePost Message

  Moving Sum
Posted by Dimitry on Sep-26-2012 22:35
Hi, Pete.
Is there a way to get a Moving Sum on the array of doubles? I need to use different
intervals, summing the elements on that interval, creating moving Sum and selecting
max value from the result.

There are all kinds of ArrayMath functions but the one I need is missing. If I would be
using MovAvg it would look like this:

n=60
MovSum = New ArrayMath(stormdata).movAvg(n).result()
MovSum = New ArrayMath(MovSum ).replace(1.7E+308, 0).result()
maxSliderValue =MovSum.Max


movAvg(n) needs to be movSum(n), which does not exist. Is there a way around?

Thanks,
Dimitry

  Re: Moving Sum
Posted by Peter Kwan on Sep-26-2012 23:59
Hi Dimitry,

The average value is the sum divided by n (the number of elements in computing the sum). So you can just get the maximum moving average, multiply by n, and this is the maximum moving sum.

Hope this can help.

Regards
Peter Kwan

  Re: Moving Sum
Posted by Dimitry on Sep-27-2012 00:09
Thanks, Peter. What was I thinking...of course it is.