OPEN-SOURCE SCRIPT

Profit Filter RSI+MACD

26
//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)

Thông báo miễn trừ trách nhiệm

Thông tin và ấn phẩm không có nghĩa là và không cấu thành, tài chính, đầu tư, kinh doanh, hoặc các loại lời khuyên hoặc khuyến nghị khác được cung cấp hoặc xác nhận bởi TradingView. Đọc thêm trong Điều khoản sử dụng.