Nicolas

MA trend colored

Category: Indicators By: Nicolas Created: November 21, 2018, 2:56 PM
November 21, 2018, 2:56 PM
Indicators
5 Comments
MA trend colored

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.

//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

 

Download
Filename: PRC_TrendColored.itf
Downloads: 370
Nicolas
Nicolas Legend
I created ProRealCode because I believe in the power of shared knowledge. I spend my time coding new tools and helping members solve complex problems. If you are stuck on a code or need a fresh perspective on a strategy, I am always willing to help. Welcome to the community!
Author’s Profile

Comments

Hans63
7 years ago
#

Would you add the possibility to color also the Heikin Ashi and bar chart?

Nicolas
7 years ago
#

That's possible, please open a new topic in the indicator forum explaining what you need exactly and i'll help you there.

capgros
8 years ago
#

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

osupero
8 years ago
#

https://www.screencast.com/t/1FD7s0YdZ......DE NUEVO MIL GRACIAS

osupero
8 years ago
#

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

ProRealCode ProRealCode
Loading...