input length = 14;
input overBought = 70;
input overSold = 30;
input averageType = AverageType.WILDERS;
input price = close;
DefineGlobalColor("green1", CreateColor(175, 220, 175)) ;
DefineGlobalColor("green3", CreateColor(90, 220, 90)) ;
DefineGlobalColor("green4", CreateColor(50, 150, 50)) ;
DefineGlobalColor("red1", CreateColor(225, 125, 125)) ;
DefineGlobalColor("red2", CreateColor(200, 75, 75)) ;
DefineGlobalColor("red3", CreateColor(150, 50, 50)) ;
def RSI = Round(RSI(length, overBought, overSold, price, averageType), 2);
AddLabel(1, "RSI " + RSI,(
if RSI between 50.01 and 60 then createcolor(175, 220, 175) else
if RSI between 40.01 and 50 then Color.PINK else
if RSI between 60.01 and 70 then Color.LIGHT_GREEN else
if RSI between 30.01 and 40 then CreateColor(225, 125, 125) else
if RSI between 70.01 and 80 then CreateColor(90, 220, 90) else
if RSI between 20.01 and 30 then CreateColor(200, 50, 50) else
if RSI between 10.01 and 20 then CreateColor(150, 50, 50) else
if RSI < 10 then Color.RED else
if RSI between 80 and 90 then CreateColor(50, 150, 50) else
Color.GREEN));