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

Skrip sumber terbuka

Dalam semangat sebenar TradingView, penulis telah menerbitkan kod Pine ini sebagai sumber terbuka supaya pedagang dapat memahami dan mengesahkannya. Sorakan kepada penulis! Anda boleh menggunakan perpustakaan ini secara percuma, tetapi penggunaan semula kod dalam penerbitan ini adalah dikawal oleh Peraturan dalaman. Anda boleh menyukainya untuk menggunakannya pada carta.

Ingin menggunakan skrip ini pada carta?

Penafian