Here is my script. It just changes bars to blue and yellow. Though i see there are candles which satisfy green and red. Please can anyone help? Thanks in advanace
if (close > open) and ((high-low/2) < (close - open))
c:=color.green
else if (close > open) and ((high-low/2) > (close - open))
c:=color.blue
else if (close < open) and ((high-low/2) < (open - close))
c:=color.red
else if (close < open) and ((high-low/2) > (open - close))
c:=color.yellow
barcolor(c)