Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //@version=3
- //by MedicWillCrypto filters added and label changed picture2
- //This study is an custom implimentation of scripts written from Gaussian Channel and Wave Trend.
- //Code was customized and made to fit the Medic's Pulse Indicator.
- //Should be used with MPI-Pulse, MPI-RS amd MPI-Vix.
- study("MPI - Medic's Pulse Indicator v6.9 Filter v3", overlay=true)
- isLongOpen = false
- isShortOpen = false
- //Order open on previous ticker?
- isLongOpen := nz(isLongOpen[1])
- isShortOpen := nz(isShortOpen[1])
- fast_length = 8
- slow_length = 21
- src = close
- signal_length = 9
- sma_source = false
- sma_signal = false
- // Calculating
- fast_ma = sma_source ? sma(src, fast_length) : ema(src, fast_length)
- slow_ma = sma_source ? sma(src, slow_length) : ema(src, slow_length)
- macd = fast_ma - slow_ma
- length = 21
- mult = 0.7
- basis = sma(macd, length)
- dev = mult * stdev(macd, length)
- upper = basis + dev
- lower = basis - dev
- Shortfilter = input(title="Short Filter (static)", type=integer, defval=-10000)
- Longfilter = input(title="Long Filter (static)", type=integer, defval=-10000)
- BBGap = input(title="Dynamic Filter", type=integer, defval=3000)
- EMABreak = input(title="EMA Break", type=integer, defval=21)
- EMAB = ema(close, EMABreak)
- LongSignal = crossover(macd, lower) and basis <= (Longfilter*-1/100) and (upper - lower) > BBGap*1/100 and close > EMAB
- ShortSignal = crossunder(macd, upper) and basis >= (Shortfilter*1/100) and (upper - lower) > BBGap*1/100 and close < EMAB
- //crossoverLongStrong = crossunder(macd, upper) and basis < -100
- //crossoverShortStrong = crossunder(macd, upper) and basis < 100
- //crossoverLongADD = crossover(macd, lower)
- //crossoverShortADD = crossunder(macd, upper)
- //crossoverSecureShort = crossunder(macd,lower) and basis >= (Shortfilter*1/100)
- //crossoverSecureLong = crossover(macd,upper) and basis <= (Longfilter*-1/100)
- //BasisNegative = crossover(0,basis)
- //BasisPositive = crossunder(0,basis)
- plot(EMAB, linewidth=4, transp=5, color=green, title="EMA Break")
- plotshape(LongSignal, title="Long", style=shape.triangleup, location=location.belowbar, text="Long", color=green, transp=0, size=size.small)
- plotshape(ShortSignal, title="Short", style=shape.triangledown, location=location.abovebar, text="Short", color=red, transp=0, size=size.small)
- //plotshape(BasisNegative, title="Basis Negative", style=shape.xcross, location=location.bottom, text="---Pulse---", color=green, transp=0, size=size.tiny)
- //plotshape(BasisPositive, title="Basis Positive", style=shape.xcross, location=location.bottom, text="+++Pulse+++", color=red, transp=0, size=size.tiny)
- //plotshape(crossoverSecureShort, title="Secure Short", style=shape.xcross, location=location.belowbar, text="Secure Short", color=red, transp=0, size=size.tiny)
- //plotshape(crossoverSecureLong, title="Secure Long", style=shape.xcross, location=location.belowbar, text="Secure Long", color=green, transp=0, size=size.tiny)
- // Set up alert
- //alertcondition(crossover(macd,lower), message="test LONG alert")
- //alertcondition(crossunder(macd, upper), message="test SHORT alert")
- //alertcondition(crossover(0,basis), message="basis change test")
- //alertcondition(crossunder(0,basis), message="basis change test2")
- // Colour background of alert setups
- bgcolor(color=LongSignal ? green :
- ShortSignal ? red : na ,
- transp=80)
- ExternalIndicator = input(close, "External Indicator")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement