OPEN-SOURCE SCRIPT

Supertrend + Stoch RSI Confirmation

//version=5
indicator("Supertrend + Stoch RSI Confirmation", overlay=true)

// تنظیمات سوپرترند
atrPeriod = input(9, title="ATR Period")
atrMultiplier = input(1.0, title="ATR Multiplier")
src = hl2

// محاسبات سوپرترند
[supertrendLine, supertrendDirection] = ta.supertrend(atrMultiplier, atrPeriod)

// تنظیمات Stoch RSI
stochLength = input(14, title="Stoch RSI Length")
kSmooth = input(3, title="K Smoothing")
dSmooth = input(3, title="D Smoothing")

// محاسبات Stoch RSI
rsiValue = ta.rsi(close, stochLength)
stochK = ta.sma(ta.stoch(rsiValue, rsiValue, rsiValue, stochLength), kSmooth)
stochD = ta.sma(stochK, dSmooth)

// سیگنال خرید: سوپرترند خرید + تایید Stoch RSI از پایین به بالا
buySignal = (supertrendDirection == 1) and (ta.crossover(stochK, 20)) // خط آبی Stoch RSI خط 20 را قطع کند

// سیگنال فروش: سوپرترند فروش + تایید Stoch RSI از بالا به پایین
sellSignal = (supertrendDirection == -1) and (ta.crossunder(stochK, 80)) // خط آبی Stoch RSI خط 80 را قطع کند

// نمایش سیگنال‌ها بر روی چارت
plotshape(series=buySignal, location=location.belowbar, color=color.green, style=shape.labelup, title="Buy Signal", text="Buy")
plotshape(series=sellSignal, location=location.abovebar, color=color.red, style=shape.labeldown, title="Sell Signal", text="Sell")

// نمایش سوپرترند بر روی چارت
plot(supertrendLine, color=(supertrendDirection == 1 ? color.green : color.red), linewidth=2)
Bands and Channels

Open-source script

In true TradingView spirit, the author of this script has published it open-source, so traders can understand and verify it. Cheers to the author! You may use it for free, but reuse of this code in publication is governed by House rules. You can favorite it to use it on a chart.

Want to use this script on a chart?

Disclaimer