Just added "notifications" to the previous script I found from mattlacoco.
study(title='Buy Blue Sell Red - Notification', shorttitle='BBSR-N', overlay=true) // vars emaPeriod = input(title="EMA Period", type=integer, defval=34) showWave = input(title="Show Wave", type=bool, defval=false) // build wave emaHigh = ema(high,emaPeriod) emaLow = ema(low,emaPeriod) emaClose = ema(close,emaPeriod) waveHigh = showWave == true ? emaHigh : na waveLow = showWave == true ? emaLow : na waveClose = showWave == true ? emaClose : na prevCandleColor = close[1] < emaLow[1] ? close[1] > open[1] ? -2 : -1 : close[1] > emaHigh[1] ? close[1] > open[1] ? 2 : 1 : close[1] > open[1] ? 0 : 0 currCandleColor = close < emaLow ? close > open ? -2 : -1 : close > emaHigh ? close > open ? 2 : 1 : close > open ? 0 : 0 candleChange = prevCandleColor <= 0 and currCandleColor > 0 ? 1 : prevCandleColor >= 0 and currCandleColor < 0 ? -1 : 0 plotchar(candleChange == 1 ? 1 : na, char="*", title="Changed to Bull", transp=100, color=blue) plotchar(candleChange == -1 ? 1 : na, char="*", title="Changed to Bear", transp=100, color=red) plot(waveHigh, title="EMA High",color=red ) plot(waveLow, title="EMA Low", color=blue) plot(waveClose, title="EMA Close", color=silver) // paint candles according to close position relative to wave barcolor(close < emaLow ? close > open ? red : maroon : close > emaHigh ? close > open ? blue : navy : close > open ? silver : gray)