Advertisement
saisri

zero lag rsi

Jul 15th, 2012
282
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.08 KB | None | 0 0
  1. /*ZeroLag RSI */
  2. /*Code adapted from ZeroLag Williams %R Indicator */
  3. /* Additional params added for change of RSI periods and EMA1&2 */
  4.  
  5. GraphXSpace = 3;
  6.  
  7. RSIPeriod=Param("RSI Period Length", 14, 3 , 50, 1);
  8. R = RSI(RSIperiod);
  9.  
  10. MaxGraph=10;
  11. Period1=Param("Period 1", 10, 5, 50, 1);
  12. Period2=Param("Period 2", 10, 5, 50, 1);
  13. EMA1= EMA(R,Period1);
  14. EMA2= EMA(EMA1,Period2);
  15. Difference= EMA1 - EMA2;
  16. ZeroLagEMA= EMA1 + Difference;
  17. PR=abs(ZeroLagEMA);
  18.  
  19. Graph0=PR;
  20.  
  21. MoveAvg=MA(PR,5);
  22.  
  23. // Graph1=MoveAvg; Remove the // if you want a Crossover MA to plot
  24. // Graph1Color=colorTan;
  25.  
  26. Graph0Style=4;
  27. upbar= PR>= MoveAvg AND PR>= Ref(PR,-1) ;
  28. downbar=(PR < MoveAvg) OR PR>= MoveAvg AND PR< Ref(PR,-1) ;
  29. barcolor = IIf( downbar,colorRed, IIf( upbar, colorBrightGreen, 7));
  30. Graph0BarColor = ValueWhen( barcolor != 0, barcolor );
  31. Graph2=30;
  32. Graph3=70;
  33.  
  34. Graph2Style=Graph3Style=Graph4Style=1;
  35. Graph4Color=2;
  36. Graph2Color=5;
  37. Graph3Color=4;
  38.  
  39. Graph5=0;
  40. Graph6=100;
  41. Graph5Style=Graph6Style=1;
  42. Graph5Color=Graph6Color=2;
  43.  
  44. Title=Name()+" - ZeroLag RSI V2 :"+WriteVal(PR)+"%";
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement