Paint the candlesticks with conditions based on CCI and MACD.
// Variable
a=CCI[14](typicalPrice)
b=MACDline[12,26,9](close)
c = ExponentialAverage[9](b)
//Hausse
if a > 0 and b > c then
r = 0
b = 0
g = 255
//Baisse
elsif a < 0 and b < c then
r = 255
b = 0
g = 0
//Neutre
elsif a > 0 and b < c OR a < 0 and b > c then
r = 195
g = 195
b = 195
endif
DRAWCANDLE(open,high,low,close) coloured(r,g,b)
RETURN
You must be logged in to post a comment.
Hi I down loaded the ITF file, it paints red for a down trend but for all up trends the candles are grey. Could you advise how I get the candles to paint blue please
c=exponentialaverage[9](MACDLine[12,26,9](close))
Yes, line 5 is truncated. I can't edit, please replace by:
line 22: r = 195 by r = 0 line 23: g = 195 by g = 0 line 24: b = 195 by b = 255 ;)