vdubus

BIGMAC_DD_VX2

200
MACD_VX1
//Modified MACD and RSI alert

Open-source script

In true TradingView spirit, the author of this script has published it open-source, so traders can understand and verify it. Cheers to the author! You may use it for free, but reuse of this code in a publication is governed by House Rules. You can favorite it to use it on a chart.

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.

Want to use this script on a chart?
study(title="BIGMAC_DD_VX2", shorttitle="BIGMAC_DD_VX2")
source = close
fastLength = input(13, minval=1), slowLength=input(34,minval=1)
signalLength=input(5,minval=1)
fastMA = ema(source, fastLength)
slowMA = ema(source, slowLength)
macd = fastMA - slowMA
signal = sma(macd, signalLength)
hist = macd - signal
plot(hist, style=histogram, color=black, linewidth=3)
plot(macd, color=red, linewidth=1)
plot(signal, color=blue, linewidth=2)
plot(cross(signal, macd) ? signal : na, color=black, style = circles, linewidth = 4)
//============================================
//Modified MACD and RSI alert / munsifk 
fastLength2 = input(8, minval=1)
slowLength2 = input(34,minval=1)
signalLength2=input(3,minval=1)
hline(0, color=purple, linestyle=line)
fastMA2 = ema(close, fastLength2)
slowMA2 = ema(close, slowLength2)
macd2 = fastMA2 - slowMA2
signal2 = sma(macd2, signalLength2)
//------------
Length2 = input(21, minval=1)
Oversold2 = input(49, minval=1)
Overbought2 = input(51, minval=1)
xRSI = rsi(close, Length2)
pos2 = iff(xRSI > Overbought2 and signal2 < macd2, 1,
        iff(xRSI < Oversold2 and signal2 > macd2, -1, nz(pos2[1], 0))) 
plot(pos2, title="pos", style=area, color=red, transp=80)
//--------------------------------------------------------//