OPEN-SOURCE SCRIPT

RSI-Based Buy/Sell Signals (15m)

//version=5
indicator("RSI-Based Buy/Sell Signals (15m)", overlay=false)

// Set the timeframe to 15 minutes
fifteenMinClose = request.security(syminfo.tickerid, "15", close)

// RSI Calculation
rsi = ta.rsi(fifteenMinClose, 14)

// Buy/Sell Conditions
buySignal = ta.crossover(rsi, 30) // Buy when RSI crosses above 30
sellSignal = ta.crossunder(rsi, 70) // Sell when RSI crosses below 70

// Plot Buy/Sell Signals in RSI pane
plotshape(buySignal, style=shape.triangleup, location=location.belowbar, color=color.new(color.green, 80), size=size.tiny, text="BUY")
plotshape(sellSignal, style=shape.triangledown, location=location.abovebar, color=color.new(color.red, 80), size=size.tiny, text="SELL")

// Plot RSI in a separate pane
hline(70, "Overbought", color=color.red)
hline(30, "Oversold", color=color.green)
plot(rsi, color=color.blue, title="RSI")

Wyłączenie odpowiedzialności