OPEN-SOURCE SCRIPT

Stochastic RSI with Custom Level

120
//version=6
indicator("Stochastic RSI with Custom Level", overlay = false)

// Input parameters
rsiLength = input.int(14, title="RSI Length")
stochLength = input.int(14, title="Stochastic Length")
kSmooth = input.int(3, title="K Smoothing")
dSmooth = input.int(3, title="D Smoothing")
customLevel = input.float(80, title="Custom Level for True/False Output")
timeframe = input.timeframe("2D", title="Timeframe")

// Calculate RSI
rsi = ta.rsi(close, rsiLength)

// Calculate Stochastic RSI
stochRsi = ta.stoch(rsi, rsi, rsi, stochLength)
k = ta.sma(stochRsi, kSmooth)
d = ta.sma(k, dSmooth)

// Plot Stochastic RSI
plot(k, title="Stochastic RSI %K", color=color.blue)
plot(d, title="Stochastic RSI %D", color=color.red)

// True/False output based on custom level
output = k > customLevel
plotshape(output, title="Output", location=location.top, color=color.green, style=shape.labelup, text="True")

// Screener functionality
if (output)
label.new(bar_index, high, "Selected", color=color.green, textcolor=color.white, style=label.style_label_up)

Wyłączenie odpowiedzialności

Informacje i publikacje przygotowane przez TradingView lub jego użytkowników, prezentowane na tej stronie, nie stanowią rekomendacji ani porad handlowych, inwestycyjnych i finansowych i nie powinny być w ten sposób traktowane ani wykorzystywane. Więcej informacji na ten temat znajdziesz w naszym Regulaminie.