I need help with the code to achieve this.
If the bar closes above or below the previous bar high/low then color it x or y
TIA
Good morning,
you could try something like this, replacing yellow and blue with your colors from table here:
COLOURED
if close>high[1] then
DRAWCANDLE(open, high, low, close) coloured("yellow")
elsif close<low[1] then
DRAWCANDLE(open, high, low, close) coloured("blue")
endif
return