Here is another modification of a simple moving average curve. This one is filtered by standard deviation of price over 2 different periods.
I have coded this one by request, post it here for any useful purpose you’ll find to this moving average.
// parameters :
// MAperiod = 50
// STDperiod1 = 30
// STDperiod2 = 9
if(barindex>STDperiod1) then
mb = average[MAperiod](TypicalPrice)
dev = STD[STDperiod1](Close)
i = STD[STDperiod2](Close)/dev
a = 2/(STDperiod2+1)
filt = a*i*Close+(1-(a*i))*filt[1]
buffer = (mb+filt)/2
endif
if(buffer>buffer[1]) then
d=1
else
d=-1
endif
RETURN buffer coloured by d