RSI Bubble with Horizontal line

Branch

Branch

Member
VIP
How can you take this code (Use to follow price) and change it so that it will provide the RSI Percentage in a Bubble on the Lower (SubChart) with a horizontal line?

input barsBack = 0;
input price= close;

def vClose = close;
def nan = double.NaN;
def bn = BarNumber();
def month = GetMonth();
def monthDay = GetDayOfMonth(GetYYYYMMDD());
def currentBar = HighestAll(if !IsNaN(price) then bn else Double.NaN);
def highestClose = HighestAll(if IsNaN(vClose[-1]) then vClose else nan);
plot hc = highestClose;
hc.SetPaintingStrategy(PaintingStrategy.DASHES);
hc.SetDefaultColor(Color.CYAN);

# throws an error symbol at top left of chart when condition is false. click on the error symbol to view the error message
# condition , "text"
assert(barsBack >= 0, "''bars back'' cannot be negative ");
# variables


AddChartBubble(bn == currentBar - barsBack, price,
# This section for text
"Price " + ( if price == close then "$ " else if price == open then "Open: $" else if price == low then " Low: $" else if price == high then " High: $" else if price == OHLC4 then " OHLC4 $" else if price == HLC3 then " HLC3 $" else " Value: " )+ price,(

# this section for color
if price == close then color.cyan else if price == open then color.pink else if price == low then color.yellow else if price == high then Color.White
else if price == OHLC4 then Color.Dark_Orange else if price == HLC3 then Color.Magenta else color.Plum), yes);
 

Similar threads

Top