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.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 |
// 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 |
Share this
No information on this site is investment advice or a solicitation to buy or sell any financial instrument. Past performance is not indicative of future results. Trading may expose you to risk of loss greater than your deposits and is only suitable for experienced investors who have sufficient financial means to bear such risk.
ProRealTime ITF files and other attachments :
Filename : download the ITF files
How to import ITF files into ProRealTime platform?
PRC is also on YouTube, subscribe to our channel for exclusive content and tutorials