bobbyaxelrod
New member
Hi, I'm having trouble getting background colors to show for a particular script. Right now the background doesn't change color at all, it stays black, though the calculation of the script for "ADR" does work. The full script is below. Any suggestions are much appreciated. Thanks!
#Hint: Average Daily Range
def len = 1;
def price = close;
def dayHigh = DailyHighLow(AggregationPeriod.DAY, len, 0, no).DailyHigh;
def dayLow = DailyHighLow(AggregationPeriod.DAY, len, 0, no).DailyLow;
def ADR = (price - dayLow) / (dayHigh - dayLow)*100;
AddLabel(yes,Round(ADR,0)+"%");
AssignBackgroundColor (if ADR>.80 then Color.GREEN else if ADR>.60 then color.LIGHT_GREEN else if ADR>.40 then color.YELLOW else if ADR>.20 then color.PINK else color.RED);
#Hint: Average Daily Range
def len = 1;
def price = close;
def dayHigh = DailyHighLow(AggregationPeriod.DAY, len, 0, no).DailyHigh;
def dayLow = DailyHighLow(AggregationPeriod.DAY, len, 0, no).DailyLow;
def ADR = (price - dayLow) / (dayHigh - dayLow)*100;
AddLabel(yes,Round(ADR,0)+"%");
AssignBackgroundColor (if ADR>.80 then Color.GREEN else if ADR>.60 then color.LIGHT_GREEN else if ADR>.40 then color.YELLOW else if ADR>.20 then color.PINK else color.RED);