TwoWayTrader
New member
Hey all!
I need help creating specific background color for different tiers of percentages for my Watchlist column:
50% + = violet
30% - 50% = cyan
0% - 30% = light green
0% = black
Less than 0% = grey
Here's the code I have so far ...Thank you!!
I need help creating specific background color for different tiers of percentages for my Watchlist column:
50% + = violet
30% - 50% = cyan
0% - 30% = light green
0% = black
Less than 0% = grey
Here's the code I have so far ...Thank you!!
Code:
def chng = round((close / close[1] -1),2);
addlabel(yes, asPercent(chng));
assignBackgroundColor(if chng > 0 then color.BLUE else if chng < 0 then color.GrAY else color.CuRRENT);
#end