Could you be a little more clear about the SMA because when I set it up it did work in a few spots but no where near the full spectrum.
BR
Ray
carl » Fri Jan 20, 2017 6:56 am wrote:Hi Everyone,
I am not sure whether the implications of the method of calculating Slope are well understood. According to the code:
dblTma = iMA( NULL, tf, maperiod, 0, MODE_LWMA, PRICE_CLOSE, shiftWithoutSunday );
dblPrev = ( iMA( NULL, tf, maperiod, 0, MODE_LWMA, PRICE_CLOSE, shiftWithoutSunday + 1 ) * 231 + iClose( NULL, tf, shiftWithoutSunday ) * 20 ) / 251;
dblDiff = dblTma - dblPrev
Slope = dblDiff/ atr;
Now, it can easily be shown that the difference of the two LWMA moving averages is actually equivalent to:
dbfDiff = Close[0] - iMA( NULL, tf, maperiod, 0, MODE_SMA, PRICE_CLOSE, shiftWithoutSunday+1 );
What this means is that anybody who is trading the signals coming from the CSS crossing at zero, is in effect trading a signal which could simply be derived from observing the crossing of the Close of a simple moving average of the same period (shifted by one bar). This can easily be confirmed visually by adding the appropriate SMA to a chart and observe that the crossing of the SMA correspond to those of the CSS lines.
Carl