Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //@version=2
- // ver 1 alerts show significant stoch rsi crossovers as long as they arent in outermost bounds
- // ver 2 fixed error with > to >= that caused some alerts to not appear
- // ver 3 changed from symbols to columns to make it easier to set up real trading view alerts with it!
- study(title="Stochastic RSI with Crossover Alerts", shorttitle="Stoch RSI with Crossover Alerts")
- doline( lengthRSI, lengthStoch, smooth ) =>
- rsi1 = rsi( close, lengthRSI)
- k = sma(stoch(rsi1, rsi1, rsi1, lengthStoch), smooth)
- d = sma(k, smooth)
- [k,d]
- [k1, d1] = doline( 9, 14, 3 )
- plot( k1, transp = 50, linewidth=2, color=orange )
- plot( d1, transp = 50, linewidth=2, color=orange )
- [k5, d5] = doline( 45, 70, 15 )
- plot( k5, transp = 50, linewidth=2, color=teal )
- plot( d5, transp = 50, linewidth=2, color=teal )
- [k30, d30] = doline( 270, 440, 90 )
- plot( k30, transp = 50, linewidth=2, color=blue )
- plot( d30, transp = 50, linewidth=2, color=blue )
- [k60, d60] = doline( 540, 840, 180 )
- plot( k60, transp = 50, linewidth=2, color=red )
- plot( d60, transp = 50, linewidth=2, color=red )
- [k120, d120] = doline( 1080, 1680, 360 )
- plot( k120, transp = 50, linewidth=2, color=purple )
- plot( d120, transp = 50, linewidth=2, color=purple )
- h0 = hline(98)
- h1 = hline(2)
- //fill(h0, h1, color=purple, transp=95)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement