متن کامل آگهی:
//@version=4study("RSI Strategy", shorttitle="RSI Strategy", overlay=true)
// Parametersoverbought = 70oversold = 30rsi\_period = 14min\_duration = 4max\_duration = 100
// Calculate RSIrsi = rsi(close, rsi\_period)
// Check if RSI is overbought or oversold for the specified durationlongOverbought = sum(rsi > overbought ? 1 : 0, max\_duration) >= min\_durationlongOversold = sum(rsi < oversold ? 1 : 0, max\_duration) >= min\_duration
// Generate signalsbuySignal = crossover(rsi, oversold) and longOversoldsellSignal = crossunder(rsi, overbought) and longOverbought
// Calculate RSI divergencepriceDelta = close - close\[1\]rsiDelta = rsi - rsi\[1\]divergence = priceDelta \* rsiDelta < 0
strongBuySignal = buySignal and divergencestrongSellSignal = sellSignal and divergence
// Plottingplotshape(series=buySignal and not strongBuySignal, title="Buy Signal", location=location.belowbar, color=color.green, style=shape.labelup, text="Buy")plotshape(series=sellSignal and not strongSellSignal, title="Sell Signal", location=location.abovebar, color=color.red, style=shape.labeldown, text="Sell")
plotshape(series=strongBuySignal, title="Strong Buy Signal", location=location.belowbar, color=color.green, style=shape.triangleup, text="Strong Buy")plotshape(series=strongSellSignal, title="Strong Sell Signal", location=location.abovebar, color=color.red, style=shape.triangledown, text="Strong Sell")
// Plot RSI for reference//hline(overbought, "Overbought", color=color.red)//hline(oversold, "Oversold", color=color.green)//plot(rsi, "RSI", color=color.blue)