Here is an image to get a clearer picture. I'm trying to highlight the area of RSI that is over 70, BUT highlighting begins AFTER 3 bars have passed. I get how to do highlight whenever RSI is over 70, but can't figure out how to do it AFTER 3 bars have passed when it crosses over 70. Thank you so much
EDIT: Here is my code so far
//@version=5
indicator(title="Relative Strength Index", shorttitle="RSI")
rsi = ta.rsi(close,14)
l_60 = 60
l_40 = 40
ob = rsi > 60 ? rsi : l_60
os = rsi < 40 ? rsi : l_40
p1 = plot(series=l_60, color=color.new(#FF5252,20), linewidth=1)
p2 = plot(series=ob, color=color.new(#FF5252,20), linewidth=1)
p3 = plot(series=l_40, color=color.new(#4CAF50,20), linewidth=1)
p4 = plot(series=os, color=color.new(#4CAF50,20), linewidth=1)
fill(p1, p2, color=color.new(#4CAF50,10))
fill(p3, p4, color=color.new(#FF5252,10))
plot(rsi, "RSI", color=#7E57C2)
Edit#2: if this isn't possible, could making a rectangular box work? Im not sure how to make a rectangular box using pinescript but how do you make a box with the vertical line starting THREE bars since crossover? thnx
