I'm getting buy and sell signals even though the stoch RSI is not below 20 (buy) and above 80 (Sell) on all three timeframes.
Would anybody know how to fix this?
You're help is appreciated!
Here is the script....
//@version=5
indicator("StochRSI Highlight", overlay=true)
// Define StochRSI for different timeframes
stoch_rsi_4h = request.security(syminfo.tickerid, "240", ta.stoch(close, close, close, 14))
stoch_rsi_1h = request.security(syminfo.tickerid, "60", ta.stoch(close, close, close, 14))
stoch_rsi_15m = request.security(syminfo.tickerid, "15", ta.stoch(close, close, close, 14))
// Set conditions for highlighting buy signal
buy_highlight_condition = stoch_rsi_4h < 20 and stoch_rsi_1h < 20 and stoch_rsi_15m < 20
// Set conditions for highlighting sell signal
sell_highlight_condition = stoch_rsi_4h > 80 and stoch_rsi_1h > 80 and stoch_rsi_15m > 80
// Plot shapes for buy signal
plotshape(series=buy_highlight_condition, title="Buy Highlight", color=color.new(color.green, 0), style=shape.triangleup, location=location.belowbar)
// Plot shapes for sell signal
plotshape(series=sell_highlight_condition, title="Sell Highlight", color=color.new(color.red, 0), style=shape.triangledown, location=location.abovebar)
I cant get it to print a signal only when all 3 time frames are abocve 80 or below 20