Simple indicator that color the candlesticks according to:
- the trend direction, based on 2 moving averages (period and type can be modified)
- the slope of the faster moving average, if it declines in a bullish trend or ascend in a bearish trend
Coded because of a request in the ProBuilder 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 38 |
//PRC_TrendColored | indicator //21.11.2018 //Nicolas @ www.prorealcode.com //Sharing ProRealTime knowledge // --- settings period1 = 10 MA1type = 2 period2 = 50 MA2type= 2 // --- end of settings avg1 = average[period1,MA1type] avg2 = average[period2,MA2type] if avg1>avg2 then r=0 g=255 b=0 if avg1<avg1[1] then r=0 g=128 b=0 endif elsif avg1<avg2 then r=255 g=0 b=0 if avg1>avg1[1] then r=255 g=99 b=71 endif endif drawcandle(open,high,low,close) coloured(r,g,b) return |
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
Buenisimo Sr Nicolas, seria posible que sólo marcara por encima o por debajo de una media movil ponderada y que marcara color verde por encima y color rojo por abajo..tremendamente agradecido estaria..Gracias por su aporte
https://www.screencast.com/t/1FD7s0YdZ……DE NUEVO MIL GRACIAS
Bonjour @Nicolas,
Thanks a lot for this tool, it is very useful for me. I would like to suggest you an upgrade if it is possible…
When this indicator is on, candles get painted OVER the MA´s in the chart, instead of behind the MA´s in the chart as usual, could you add a piece of code for the candles to appear behind the MA´s as they use to do?
Thank you very much in advance!
Pablo
Would you add the possibility to color also the Heikin Ashi and bar chart?
That’s possible, please open a new topic in the indicator forum explaining what you need exactly and i’ll help you there.