OPEN-SOURCE SCRIPT
SUPER TREND + RSI FILTER PRO

version=5
indicator("SUPER TREND + RSI FILTER PRO", overlay=true, timeframe="", timeframe_gaps=true)
//---------------------------
// INPUTS
//---------------------------
factor = input.float(3.0, "SuperTrend Factor")
atr_len = input.int(10, "ATR Length")
rsi_len = input.int(14, "RSI Length")
rsi_buy = input.int(50, "RSI Buy Level")
rsi_sell = input.int(50, "RSI Sell Level")
//---------------------------
// SUPERTREND CALCULATION
//---------------------------
atr = ta.atr(atr_len)
upperBand = close + factor * atr
lowerBand = close - factor * atr
trend = 0.0
trend := close > nz(trend[1]) ? math.max(lowerBand, nz(trend[1])) : math.min(upperBand, nz(trend[1]))
// Coloration
bull = close > trend
bear = close < trend
//---------------------------
// RSI FILTER
//---------------------------
rsi = ta.rsi(close, rsi_len)
//---------------------------
// BUY & SELL SIGNALS
//---------------------------
buySignal = bull and rsi > rsi_buy and close > trend
sellSignal = bear and rsi < rsi_sell and close < trend
//---------------------------
// PLOT SUPERTREND
//---------------------------
plot(trend, color=bull ? color.green : color.red, linewidth=2, title="SuperTrend")
//---------------------------
// BUY / SELL MARKERS
//---------------------------
plotshape(buySignal, title="Buy", style=shape.labelup, color=color.green, size=size.small, text="BUY")
plotshape(sellSignal, title="Sell", style=shape.labeldown, color=color.red, size=size.small, text="SELL")
//---------------------------
// ALERTS
//---------------------------
alertcondition(buySignal, title="Buy Signal", message="BUY Signal - SuperTrend + RSI Filter")
alertcondition(sellSignal, title="Sell Signal", message="SELL Signal - SuperTrend + RSI Filter")
indicator("SUPER TREND + RSI FILTER PRO", overlay=true, timeframe="", timeframe_gaps=true)
//---------------------------
// INPUTS
//---------------------------
factor = input.float(3.0, "SuperTrend Factor")
atr_len = input.int(10, "ATR Length")
rsi_len = input.int(14, "RSI Length")
rsi_buy = input.int(50, "RSI Buy Level")
rsi_sell = input.int(50, "RSI Sell Level")
//---------------------------
// SUPERTREND CALCULATION
//---------------------------
atr = ta.atr(atr_len)
upperBand = close + factor * atr
lowerBand = close - factor * atr
trend = 0.0
trend := close > nz(trend[1]) ? math.max(lowerBand, nz(trend[1])) : math.min(upperBand, nz(trend[1]))
// Coloration
bull = close > trend
bear = close < trend
//---------------------------
// RSI FILTER
//---------------------------
rsi = ta.rsi(close, rsi_len)
//---------------------------
// BUY & SELL SIGNALS
//---------------------------
buySignal = bull and rsi > rsi_buy and close > trend
sellSignal = bear and rsi < rsi_sell and close < trend
//---------------------------
// PLOT SUPERTREND
//---------------------------
plot(trend, color=bull ? color.green : color.red, linewidth=2, title="SuperTrend")
//---------------------------
// BUY / SELL MARKERS
//---------------------------
plotshape(buySignal, title="Buy", style=shape.labelup, color=color.green, size=size.small, text="BUY")
plotshape(sellSignal, title="Sell", style=shape.labeldown, color=color.red, size=size.small, text="SELL")
//---------------------------
// ALERTS
//---------------------------
alertcondition(buySignal, title="Buy Signal", message="BUY Signal - SuperTrend + RSI Filter")
alertcondition(sellSignal, title="Sell Signal", message="SELL Signal - SuperTrend + RSI Filter")
סקריפט קוד פתוח
ברוח האמיתית של TradingView, יוצר הסקריפט הזה הפך אותו לקוד פתוח, כך שסוחרים יוכלו לעיין בו ולאמת את פעולתו. כל הכבוד למחבר! אמנם ניתן להשתמש בו בחינם, אך זכור כי פרסום חוזר של הקוד כפוף ל־כללי הבית שלנו.
כתב ויתור
המידע והפרסומים אינם מיועדים להיות, ואינם מהווים, ייעוץ או המלצה פיננסית, השקעתית, מסחרית או מכל סוג אחר המסופקת או מאושרת על ידי TradingView. קרא עוד ב־תנאי השימוש.
סקריפט קוד פתוח
ברוח האמיתית של TradingView, יוצר הסקריפט הזה הפך אותו לקוד פתוח, כך שסוחרים יוכלו לעיין בו ולאמת את פעולתו. כל הכבוד למחבר! אמנם ניתן להשתמש בו בחינם, אך זכור כי פרסום חוזר של הקוד כפוף ל־כללי הבית שלנו.
כתב ויתור
המידע והפרסומים אינם מיועדים להיות, ואינם מהווים, ייעוץ או המלצה פיננסית, השקעתית, מסחרית או מכל סוג אחר המסופקת או מאושרת על ידי TradingView. קרא עוד ב־תנאי השימוש.