-- drop table if exists theData; CREATE TABLE theData ( day varchar(255), h int, l int, o int, c int, color varchar(255) ); insert into theData values ('MON',1,5,2,3, ''), ('TUE',4,10,3,5, ''), ('WED',3,9,5,4, ''), ('THU',7,12,4,9, ''), ('FRI',14,7, 9,10, ''), ('MON',1,5,2,3, ''), ('TUE',4,10,3,5, ''), ('WED',3,9,5,4, ''), ('THU',7,12,4,9, ''), ('FRI',14,7, 9,10, ''), ('MON',1,5,2,3, ''), ('TUE',4,10,3,5, ''), ('WED',3,9,5,4, ''), ('THU',7,12,4,9, ''), ('FRI',14,7, 9,10, ''); update theData set color = 'red' where o > c; update theData set color = 'dark green' where o < c; update theData set color = 'black' where o = c; PLOT HIGHLOW ALL XLABELS, HIGH, LOW, OPEN, CLOSE, COLOR OVERRIDE WITH COLLAR HORIZONTAL GRIDLINES SELECT substring(day, 1,1),h,l,o,c, color FROM theData;