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

Mã nguồn mở

Theo tinh thần TradingView thực sự, tác giả của tập lệnh này đã xuất bản dưới dạng nguồn mở để các nhà giao dịch có thể hiểu và xác minh. Chúc mừng tác giả! Bạn có thể sử dụng miễn phí. Tuy nhiên, bạn cần sử dụng lại mã này theo Quy tắc nội bộ. Bạn có thể yêu thích nó để sử dụng nó trên biểu đồ.

Bạn muốn sử dụng tập lệnh này trên biểu đồ?

Thông báo miễn trừ trách nhiệm