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が提供または推奨する金融、投資、トレード、その他のアドバイスや推奨を意図するものではなく、それらを構成するものでもありません。詳細は利用規約をご覧ください。