Easy reading of moving average price action without annoying moving average whipsaws due of volatility, this indicator simply draws “stair step” within defined point/pip treshold value (Step).
As an example, this indicator only make use of SMA and could be easily adapt by anyone 🙂
There are different approach to trade this indi : other moving average crossover or simple price breakout of the line, use it as you would, enjoy.
//parameters :
// Step = 0.0010 forex 10 pips, adapt to item you are trading
// MAperiod = 20
once ssMA = close
MA = average[MAperiod](close)
if(MA > ssMA + Step) THEN
ssMA = MA
ELSIF (MA < ssMA - Step) THEN
ssMA = MA
ELSE
ssMA = ssMA
ENDIF
RETURN ssMA
Hi Nicolas.
I found this indicator very interesting and wanted to code it in form of histogram, where I could easily see the changes of the steps, but unfortunately it does not work correctly.
There are missing bars and bars that leftovers. I wanted to download an image, but I get always an HTTP error if I try it.
Could you please tell me where is the error on the code?
The code is:
//***Stair step Moving Average
//parameters :
Step = 10// 0.0010 forex 10 pips, adapt to item you are trading
MAperiod = 7
once ssMA = close
MA = average[MAperiod](close)
IF(MA > ssMA+Step) THEN
ssMA = MA
ELSIF (MA < ssMA-Step) THEN
ssMA = MA
ELSE
ssMA = ssMA
ENDIF
IF ssMA>ssMA[1] THEN
k=1
ELSIF ssMA<ssMA[1] THEN
k=-1
ELSE
k=0
ENDIF
RETURN k AS "Signal", 0 AS "Zero"