OPEN-SOURCE SCRIPT
Мой скрипт

//version=5
indicator("Momentum Reversal Zones Strategy", overlay=true)
// === INPUTS ===
rsiLength = input.int(14, title="RSI Length")
stochK = input.int(14, title="Stochastic %K")
stochD = input.int(3, title="Stochastic %D")
rsiOverbought = input.int(70, title="RSI Overbought Level")
rsiOversold = input.int(30, title="RSI Oversold Level")
// === RSI ===
rsi = ta.rsi(close, rsiLength)
// === Stochastic Oscillator ===
k = ta.stoch(close, high, low, stochK)
d = ta.sma(k, stochD)
// === Buy Signal Conditions ===
rsiBuy = rsi < rsiOversold
stochBuy = ta.crossover(k, d) and k < 20
buySignal = rsiBuy and stochBuy
// === Sell Signal Conditions ===
rsiSell = rsi > rsiOverbought
stochSell = ta.crossunder(k, d) and k > 80
sellSignal = rsiSell and stochSell
// === Plot signals ===
plotshape(buySignal, title="Buy Signal", location=location.belowbar, color=color.green, style=shape.arrowup, size=size.small, text="BUY")
plotshape(sellSignal, title="Sell Signal", location=location.abovebar, color=color.red, style=shape.arrowdown, size=size.small, text="SELL")
// === Alerts ===
alertcondition(buySignal, title="Buy Alert", message="Buy Signal: RSI < 30 and Stochastic Bullish Crossover")
alertcondition(sellSignal, title="Sell Alert", message="Sell Signal: RSI > 70 and Stochastic Bearish Crossover")
// === Show RSI and Stochastic in separate panel ===
plot(rsi, title="RSI", color=color.blue, linewidth=1, display=display.none)
hline(rsiOverbought, "Overbought", color=color.red, linestyle=hline.style_dotted, display=display.none)
hline(rsiOversold, "Oversold", color=color.green, linestyle=hline.style_dotted, display=display.none)
indicator("Momentum Reversal Zones Strategy", overlay=true)
// === INPUTS ===
rsiLength = input.int(14, title="RSI Length")
stochK = input.int(14, title="Stochastic %K")
stochD = input.int(3, title="Stochastic %D")
rsiOverbought = input.int(70, title="RSI Overbought Level")
rsiOversold = input.int(30, title="RSI Oversold Level")
// === RSI ===
rsi = ta.rsi(close, rsiLength)
// === Stochastic Oscillator ===
k = ta.stoch(close, high, low, stochK)
d = ta.sma(k, stochD)
// === Buy Signal Conditions ===
rsiBuy = rsi < rsiOversold
stochBuy = ta.crossover(k, d) and k < 20
buySignal = rsiBuy and stochBuy
// === Sell Signal Conditions ===
rsiSell = rsi > rsiOverbought
stochSell = ta.crossunder(k, d) and k > 80
sellSignal = rsiSell and stochSell
// === Plot signals ===
plotshape(buySignal, title="Buy Signal", location=location.belowbar, color=color.green, style=shape.arrowup, size=size.small, text="BUY")
plotshape(sellSignal, title="Sell Signal", location=location.abovebar, color=color.red, style=shape.arrowdown, size=size.small, text="SELL")
// === Alerts ===
alertcondition(buySignal, title="Buy Alert", message="Buy Signal: RSI < 30 and Stochastic Bullish Crossover")
alertcondition(sellSignal, title="Sell Alert", message="Sell Signal: RSI > 70 and Stochastic Bearish Crossover")
// === Show RSI and Stochastic in separate panel ===
plot(rsi, title="RSI", color=color.blue, linewidth=1, display=display.none)
hline(rsiOverbought, "Overbought", color=color.red, linestyle=hline.style_dotted, display=display.none)
hline(rsiOversold, "Oversold", color=color.green, linestyle=hline.style_dotted, display=display.none)
Script open-source
In pieno spirito TradingView, il creatore di questo script lo ha reso open-source, in modo che i trader possano esaminarlo e verificarne la funzionalità. Complimenti all'autore! Sebbene sia possibile utilizzarlo gratuitamente, ricorda che la ripubblicazione del codice è soggetta al nostro Regolamento.
Declinazione di responsabilità
Le informazioni ed i contenuti pubblicati non costituiscono in alcun modo una sollecitazione ad investire o ad operare nei mercati finanziari. Non sono inoltre fornite o supportate da TradingView. Maggiori dettagli nelle Condizioni d'uso.
Script open-source
In pieno spirito TradingView, il creatore di questo script lo ha reso open-source, in modo che i trader possano esaminarlo e verificarne la funzionalità. Complimenti all'autore! Sebbene sia possibile utilizzarlo gratuitamente, ricorda che la ripubblicazione del codice è soggetta al nostro Regolamento.
Declinazione di responsabilità
Le informazioni ed i contenuti pubblicati non costituiscono in alcun modo una sollecitazione ad investire o ad operare nei mercati finanziari. Non sono inoltre fornite o supportate da TradingView. Maggiori dettagli nelle Condizioni d'uso.