Price Background Color Help

T

TwoWayTrader

New member
Hi all, I need assistance in correcting my script ... Here's what I am trying to accomplish
Price equal to or greater than $1 ... background color Magenta
Price equal to or greater than $10 ... background color White
Price is less than $1 ... background color grey

Thank you!

Code:
plot x = close;

assignBackgroundColor(
    if x >= 1.00 then COLOR.magenta
    else if x >= 10.00 then COLOR.white
         else if x < 0 then COLOR.gray
              else COLOR.grey);

x.assignValueColor (color.black);
 
BenTen

BenTen

Administrative
Staff
VIP
Here you go:

Code:
def x = close;

assignPriceColor(
    if x >= 1.00 then COLOR.magenta
    else if x >= 10.00 then COLOR.white
         else if x < 0 then COLOR.gray
              else COLOR.gray);
 

Similar threads

Top