OPEN-SOURCE SCRIPT
Profit Filter RSI+MACD

//version=5
indicator("Profit Filter RSI+MACD", overlay=true)
// Trend filter
ema200 = ta.ema(close, 200)
// RSI
rsi = ta.rsi(close, 14)
// MACD
macd = ta.ema(close,12) - ta.ema(close,26)
signal = ta.ema(macd,9)
// Long signal
longCond = close > ema200 and rsi < 30 and ta.crossover(macd, signal)
// Short signal
shortCond = close < ema200 and rsi > 70 and ta.crossunder(macd, signal)
// Plot signals
plotshape(longCond, title="Long Entry", location=location.belowbar,
color=color.green, style=shape.labelup, text="LONG")
plotshape(shortCond, title="Short Entry", location=location.abovebar,
color=color.red, style=shape.labeldown, text="SHORT")
// Plot EMA
plot(ema200, "EMA 200", color=color.orange)
indicator("Profit Filter RSI+MACD", overlay=true)
// Trend filter
ema200 = ta.ema(close, 200)
// RSI
rsi = ta.rsi(close, 14)
// MACD
macd = ta.ema(close,12) - ta.ema(close,26)
signal = ta.ema(macd,9)
// Long signal
longCond = close > ema200 and rsi < 30 and ta.crossover(macd, signal)
// Short signal
shortCond = close < ema200 and rsi > 70 and ta.crossunder(macd, signal)
// Plot signals
plotshape(longCond, title="Long Entry", location=location.belowbar,
color=color.green, style=shape.labelup, text="LONG")
plotshape(shortCond, title="Short Entry", location=location.abovebar,
color=color.red, style=shape.labeldown, text="SHORT")
// Plot EMA
plot(ema200, "EMA 200", color=color.orange)
Open-source script
In true TradingView spirit, the creator of this script has made it open-source, so that traders can review and verify its functionality. Kudos to the author! While you can use it for free, remember that republishing the code is subject to our House Rules.
Disclaimer
The information and publications are not meant to be, and do not constitute, financial, investment, trading, or other types of advice or recommendations supplied or endorsed by TradingView. Read more in the Terms of Use.
Open-source script
In true TradingView spirit, the creator of this script has made it open-source, so that traders can review and verify its functionality. Kudos to the author! While you can use it for free, remember that republishing the code is subject to our House Rules.
Disclaimer
The information and publications are not meant to be, and do not constitute, financial, investment, trading, or other types of advice or recommendations supplied or endorsed by TradingView. Read more in the Terms of Use.