Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // SRSYS EMA Golden/Death Cross Indicator
- study(title="SRSYS EMA-Crossing", shorttitle="EMA-Crossing", overlay=true)
- fastEmaPeriod = input(1, minval=1, title="Fast EMA Periods")
- slowEmaPeriod = input(1, minval=1, title="Slow EMA Periods")
- srcsmoothallin = input(2, minval=0, title="Smooth whole source")
- smoothFast = input(4, minval=0, title="Smooth the price Fast")
- smoothSlow = input(5, minval=0, title="Smooth the price Slow")
- off = input(1, minval=0, title="Ema Visual Offset")
- showCrosses = input(true, title="Show EMA Crosses?")
- // rsiLEN = input(10,title="RSI LEN")
- // rsiup = input(58,title="RSI UP")
- // rsidn = input(50,title="RSI DN")
- // rsiLEN = '3'
- // rsiup = '45'
- // rsidn = '3'
- src = input(type=source,defval=close)
- srcsmoothall = ema(src,srcsmoothallin)
- srcsmoothFast = ema(srcsmoothall,smoothFast)
- srcsmoothSlow = ema(srcsmoothall,smoothSlow)
- fastEma = ema(srcsmoothFast, fastEmaPeriod)
- slowEma = ema(srcsmoothSlow, slowEmaPeriod)
- // xRSI = rsi(srcsmoothall,rsiLEN)
- //xRSI = rsi(close,rsiLEN)
- plot(fastEma, title = 'Fast EMA', linewidth=1, color=lime,offset=off)
- plot(slowEma, title = 'Slow EMA', linewidth=1, color=fuchsia,offset=off)
- goldenCross = crossover(fastEma, slowEma)
- deathCross = crossover(slowEma, fastEma)
- plotarrow(showCrosses and goldenCross ? goldenCross : na, title="Golden Cross", colorup=green, maxheight=50, minheight=50, transp=0)
- plotarrow(showCrosses and deathCross*-1 ? deathCross*-1 : na, title="Death Cross", colordown=red, maxheight=50, minheight=50, transp=0)
- // plotarrow(showCrosses and goldenCross and xRSI < rsidn ? goldenCross : na, title="Golden Cross", colorup=green, maxheight=50, minheight=50, transp=0)
- // plotarrow(showCrosses and deathCross*-1 and xRSI > rsiup ? deathCross*-1 : na, title="Death Cross", colordown=red, maxheight=50, minheight=50, transp=0)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement