declare lower;
def series_h = if isNaN(close[-1]) then HIGH else CLOSE;
def series_l = if isNan(close[-1]) then LOW else CLOSE;
def RSI_H = RSI(price = series_h);
def RSI_L = RSI(price = series_l);
plot RSI_U = RSI_H;
plot RSI_D = RSI_L;
plot RSI_O = RSI();
addLabel(yes, concat("High: ", RSI_H), color.dark_green);
addLabel(yes, concat("RSI: ", RSI_o), color.dark_gray);
addLabel(yes, concat("Low: ", RSI_L), color.dark_red);
def RSI_Pct = if RSI_L != RSI_O then ((RSI_O - RSI_L) / (RSI_H - RSI_L)) * 100 else 0;
addLabel(yes, concat(RSI_Pct, " %"), color.Blue);