mladen thankyou very much for your guidance. As adviced by you and after some hit and trial i changed the following peice of code :
for (i=limit; i>=0; i--) macd = iMA(NULL,0,FastMa,0,FastMaMode,FastMaPrice,i) - iMA(NULL,0,SlowMa,0,SlowMaMode,SlowMaPrice,i);
for (i=limit; i>=0; i--) sign = iMAOnArray(macd,0,SignMa,0,SignMaMode,i);
for (i=limit; i>=0; i--) macd = iMA(NULL,0,FastMa,0,FastMaMode,FastMaPrice,i+1) - iMA(NULL,0,SlowMa,0,SlowMaMode,SlowMaPrice,i+1);
for (i=limit; i>=0; i--) sign = iMAOnArray(macd,0,SignMa,0,SignMaMode,i+1);
Can you please check it bcoz i m not at all a coder.
The way you wrote, even in a current time frame, instead of showing current value on a currently opened bar it will show the value of the first closed bar. If that is what your intention is, than the code is OK
Yes mladen, actually i wont be using higher timeframes and what i want on lower time frame is no repainting
Updating the current bar is not repainting (and it never was)
What you get the way you make it is an indicator that is always lagging 1 bar (that is why I told that if that is your intention, then it is OK). But that you can always achieve with checking for signals only on first closed bar, instead of checking fr signals on current (still opened) bar.
Yes mladen you are perfectly right that it was not a repainting indicator. And indeed if we use the indicator in current time frame then everything is fine, little problem say while backtesting occurs in smaller timeframes. What change i wanted is useful only for some limited situations only.
This indicator "DSS of LWMA 2" seems excellent. Is it possible to have alarm please ?
mladen/mrtools can you please add arrows and alerts on color change
On slope change I assume?
Yes Mladen on change color please
here you go, try it out : dss_of_lwma__alerts_2.mq4