The indicator proposes to calculate a series of several moving averages in a row (up to 5 maximum). Each of them smoothes the previous one, forming a “rainbow” type indicator.
The first moving average is calculated on the price Close, and the following ones smooth each of the previous ones with the same calculation period, which can be modified in the parameters. The type of moving average can also be changed at will with the “MAmode” setting.
The result is a cluster of moving averages of different colors to be applied to the price chart.
This indicator has been converted from LUA language following a request on the indicators forum.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 |
//PRC_Best rainbow MA | indicator //24.11.2022 //Nicolas @ www.prorealcode.com //Sharing ProRealTime knowledge //---settings MAmode=0 Period=20 NumberOfMA=5 //---end of settings MA2=undefined MA3=undefined MA4=undefined MA5=undefined numberofMA=max(min(numberofma,5),1) MA1=average[period](close) if numberofMA=2 then MA2=average[period,mamode](MA1) elsif numberofMA=3 then MA2=average[period,mamode](MA1) MA3=average[period,mamode](MA2) elsif numberofMA=4 then MA2=average[period,mamode](MA1) MA3=average[period,mamode](MA2) MA4=average[period,mamode](MA3) elsif numberofMA=5 then MA2=average[period,mamode](MA1) MA3=average[period,mamode](MA2) MA4=average[period,mamode](MA3) MA5=average[period,mamode](MA4) endif return ma1 coloured("blue"), ma2 coloured("purple"), ma3 coloured("red"), ma4 coloured("orange"), ma5 coloured("fuchsia") |
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 :PRC is also on YouTube, subscribe to our channel for exclusive content and tutorials
Hi Nicolas, thaks for your great work here, I need a scanner for the swedish OMX when market open in hte morning is there anything you think will work good from your svcreener or you can build one,, maybe based on reltive volume, price etc. Thx Magnus
Yes, sure please open a new topic in the ProScreener forum section, thank you.
Hello!
Thanks for post your indicators.
I’d like you to let me know how to draw lines for arrays in back test.
Thanks again.