//Coloured normal candles with Heikin Ashi
IF BarIndex=0 THEN
xClose = (open+high+low+close)/4
xOpen = open
xHigh = high
xLow = low
ELSE
xClose = (open+high+low+close)/4
xOpen = (xOpen[1]+xClose[1])/2
xHigh = Max(max(high, xOpen), xClose)
xLow = Min(min(Low, xOpen), xClose)
endif
if close>open then
r=0
g=255
else
r=255
g=0
endif
if (close > open and xclose > xopen) or (close < open and xclose > xopen) then
DRAWCANDLE(open, high, low, close)coloured(0,220,0)bordercolor(r,g,0)
elsif (close < open and xclose < xopen) or (close > open and xclose < xopen) then
DRAWCANDLE(open, high, low, close)coloured(255,0,0)bordercolor(r,g,0)
endif
return