Advertisement
Guest User

Untitled

a guest
Jan 29th, 2018
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. //@version=2
  2.  
  3. // ver 1  alerts show significant stoch rsi crossovers as long as they arent in outermost bounds
  4. // ver 2  fixed error with > to >= that caused some alerts to not appear
  5. // ver 3  changed from symbols to columns to make it easier to set up real trading view alerts with it!
  6.  
  7. study(title="Stochastic RSI with Crossover Alerts", shorttitle="Stoch RSI with Crossover Alerts")
  8.  
  9.  
  10. doline( lengthRSI, lengthStoch, smooth ) =>
  11.     rsi1 = rsi( close, lengthRSI)
  12.     k = sma(stoch(rsi1, rsi1, rsi1, lengthStoch), smooth)
  13.     d = sma(k, smooth)
  14.     [k,d]
  15.  
  16. [k1, d1] = doline( 9, 14, 3 )
  17. plot( k1, transp = 50, linewidth=2, color=orange )
  18. plot( d1, transp = 50, linewidth=2, color=orange )
  19.  
  20. [k5, d5] = doline( 45, 70, 15 )
  21. plot( k5, transp = 50, linewidth=2, color=teal )
  22. plot( d5, transp = 50, linewidth=2, color=teal )
  23.  
  24. [k30, d30] = doline( 270, 440, 90 )
  25. plot( k30, transp = 50, linewidth=2, color=blue )
  26. plot( d30, transp = 50, linewidth=2, color=blue )
  27.  
  28. [k60, d60] = doline( 540, 840, 180 )
  29. plot( k60, transp = 50, linewidth=2, color=red )
  30. plot( d60, transp = 50, linewidth=2, color=red )
  31.  
  32. [k120, d120] = doline( 1080, 1680, 360 )
  33. plot( k120, transp = 50, linewidth=2, color=purple )
  34. plot( d120, transp = 50, linewidth=2, color=purple )
  35.  
  36.  
  37.  
  38. h0 = hline(98)
  39. h1 = hline(2)
  40. //fill(h0, h1, color=purple, transp=95)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement