Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //@version=3
- study(title="NotMCA EMA/SMA Divergencess", shorttitle="MA", overlay=true, linktoseries=true)
- //Blood diamonds and yellow x's
- // PARAMETERS {
- // WaveTrend Overbought & Oversold lines
- obLevel = input(53, "WT Overbought Level 1")
- obLevel2 = input(60, "WT Overbought Level 2")
- osLevel = input(-53, "WT Oversold Level 1")
- osLevel2 = input(-60, "WT Oversold Level 2")
- //EMA Ribbon
- showRibbon = input(false, "Show Ribbon")
- ema1 = input(5)
- ema2 = input(11)
- ema3 = input(15)
- ema4 = input(18)
- ema5 = input(21)
- ema6 = input(25)
- ema7 = input(29)
- ema8 = input(33)
- ema9 = input(200)
- ema10 = input(10)
- // }
- // CALCULATE INDICATORS {
- //EMA Ribbon
- ema1_ = ema(close, ema1)
- ema2_ = ema(close, ema2)
- ema3_ = ema(close, ema3)
- ema4_ = ema(close, ema4)
- ema5_ = ema(close, ema5)
- ema6_ = ema(close, ema6)
- ema7_ = ema(close, ema7)
- ema8_ = ema(close, ema8)
- // RSI
- up = rma(max(change(close), 0), 14)
- down = rma(-min(change(close), 0), 14)
- rsi = down == 0 ? 100 : up == 0 ? 0 : 100 - 100 / (1 + up / down)
- // WT
- n1 = input(7, "WT Channel Length")
- n2 = input(12, "WT Average Length")
- ap = input(ohlc4)
- esa = ema(ap, n1)
- de = ema(abs(ap - esa), n1)
- ci = (ap - esa) / (0.015 * de)
- tci = ema(ci, n2)
- wt1 = tci
- wt2 = sma(wt1, 3)
- vwap_area = wt1 - wt2
- // WaveTrend Conditions
- WTCross = cross(wt1, wt2)
- WTCrossUp = wt2 - wt1 <= 0
- WTCrossDown = wt2 - wt1 >= 0
- WTOverSold = wt2 <= osLevel2
- WTOverBought = wt2 >= obLevel2
- // Signals
- longEma = crossover(ema2_, ema8_)
- redCross = crossunder(ema1_, ema2_)
- blueTriangle = crossover(ema2_, ema3_)
- redDiamond = WTCross and WTCrossDown
- yellowCross = redDiamond and rsi <= 30 and wt2 <= osLevel
- bloodDiamond = redDiamond and redCross
- shortEma = crossover(ema8_, ema2_)
- // } CALCULATE INDICATORS
- // DRAW {
- // SHAPES
- plotshape(longEma, style=shape.circle, color=#00ff00, transp=50, location=location.abovebar, size=size.tiny, title="Long EMA Signal")
- plotshape(shortEma, style=shape.circle, color=#ff0000, transp=50, location=location.abovebar, size=size.tiny, title="Short EMA Signal")
- plotshape(redCross, style=shape.xcross, color=#ff0000, transp=50, location=location.abovebar, size=size.tiny, title="Red cross")
- plotshape(blueTriangle, style=shape.triangleup, color=#0064ff, transp=50, location=location.abovebar, size=size.small, title="Blue Triangle")
- plotshape(redDiamond, style=shape.diamond, color=#ff0000, location=location.abovebar, size=size.tiny, title="Red Diamond", transp=25)
- plotshape(bloodDiamond, style=shape.diamond, color=#ff0000, location=location.abovebar, size=size.small, title="Blood Diamond", transp=15)
- plotshape(yellowCross, style=shape.xcross, color=#FDFF00, location=location.abovebar, size=size.small, title="Yellow Cross", transp=25)
- // } DRAW
- // ALERTS {
- alertcondition(redDiamond != 0, "Red Diamond", "Red Diamond")
- alertcondition(bloodDiamond != 0, "Blood Diamond", "Blood Diamond")
- alertcondition(yellowCross != 0, "YellowX", "YellowX")
- alertcondition(redCross != 0, "RedX", "RedX")
- alertcondition(longEma != 0, "Longema", "Longema")
- alertcondition(blueTriangle != 0, "Bluetriangle", "Bluetriangle")
- // } ALERTS
- plot(sma(close, 10), title="10 SMA", color=#1DE60C, linewidth=4, transp=0)
- plot(ema(close, 100), title="100 EMA", color=#FFF602, linewidth=4, transp=0)
- plot(sma(close, 200), title="200 SMA", color=#DC143C, linewidth=4, transp=0)
- plot(sma(close, 100), title="100 SMA", color=#1DE60C, linewidth=1, transp=0)
- plot(ema(close, 50), title="50 EMA", color=#E60CDA, linewidth=1, transp=0)
- plot(ema(close, 20), title="20 EMA", color=#FFC600, linewidth=1, transp=0)
- plot(ema(close, 10), title="10 EMA", color=#00FFFA, linewidth=3, transp=0)
- plot(ema(close, 200), title="GOLDEN ROPES 200 EMA", color=#FC9E03, linewidth=4, transp=0)
- plot(vwap, "VWAP", color=#FFFFFF, linewidth=4, transp=0)
Advertisement
Add Comment
Please, Sign In to add comment