Using RSI and EMA + going up switch - Its easy to find the behavior and oscillation.
study("Buy low blue points" ) f = input(title="Factor", type=float, defval=1, minval=0.1, maxval=2) ema1 = ema(close,round(9*f)) ema2 = ema(close,round(3*9*f)) ema3 = ema(close,round(4*3*9*f)) rsiClose = (rsi(ema1,round(9*f)) - 50) goingUp = ema2 > ema3 rsiBuyClose = goingUp and rsiClose < -5 and rsiClose > rsiClose[1] ? rsiClose : na rsiBuyCloseSingle = rsiBuyClose and rsiBuyClose[1] ? na : rsiBuyClose rsiColor = rsiClose < 0 ? red : green barcolor( rsiColor ) plot( 20 * goingUp, style=area, color=lime, transp=95 ) plot( rsiClose, linewidth=1, color=rsiColor ,style=histogram ) plot( rsiBuyCloseSingle , title="Buy", style=circles, linewidth=4,color=blue) //plot( mid , title='Mid', color=#00ffaa, linewidth=2) //plot( close - mid , title='Close', color=black, linewidth=2, trackprice=true)