1 (edited by nixjoe 2009-10-28 14:12:41)

Topic: about the cumulative sum

I don't know this is a bug or just a different Cumulative sum?

when i tried to convert the Cumulative Sum (CuSum for short) from FSB To mt4

I found that there quite a lot different your version to what i found on the net http://forum.mql4.com/22956

the formula which is :

IndicatorBuffer1[i]= IndicatorBuffer1[i+1]+Close[i]-average(i);    

but your is:

adCumulSum[iBar] = 
adCumulSum[iBar - 1] - adBasePrice[iBar - iPeriod] + adBasePrice[iBar];

confused...

Re: about the cumulative sum

totally different
once is minus a average number
once is minus a shift close price?

Re: about the cumulative sum

The formula used in Forex Strategy Builder makes a sum of the last N chosen prices. After that you can apply additional smoothing to it.

The quoted MT formula makes a sum of the last 24 values of a Simple Moving Average (Close, 24).