Advertisement
retesere20

old-rv

Jul 13th, 2019
133
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.04 KB | None | 0 0
  1. revBarspClose = (revBarspClose == null) ? Closes[1][0] : revBarspClose;
  2.  
  3. if (rangeBarLow == 0)
  4. {
  5. rangeBarLow = Closes[1][0];
  6. }
  7. else if (rangeBarHigh == 0)
  8. {
  9. rangeBarHigh = Closes[1][0];
  10. }
  11.  
  12.  
  13. if (BarsArray[1].Count == 0 || (BarsArray[1].IsResetOnNewTradingDay && isNewSession))
  14. {
  15. isNewBar = true;
  16. }
  17. else
  18. {
  19. if (revBarsDir == 1)
  20. {
  21. if (Closes[1][0].ApproxCompare(rangeBarHigh - revBarsOffset) <= 0)
  22. {
  23. isNewBar = true;
  24. revBarsDir = 2;
  25. }
  26. }
  27. else if (revBarsDir == 2)
  28. {
  29. if (Closes[1][0].ApproxCompare(rangeBarLow + revBarsOffset) >= 0)
  30. {
  31. isNewBar = true;
  32. revBarsDir = 1;
  33. }
  34. }
  35. else if (Closes[1][0].ApproxCompare(rangeBarLow + revBarsOffset) >= 0)
  36. {
  37. revBarsDir = 1;
  38. }
  39. else if (Closes[1][0].ApproxCompare(rangeBarHigh - revBarsOffset) <= 0)
  40. {
  41. revBarsDir = 2;
  42. }
  43. }
  44.  
  45. revBarspClose = Closes[1][0];
  46.  
  47. if (Closes[1][0] < rangeBarLow)
  48. {
  49. rangeBarLow = Closes[1][0];
  50. }
  51. else if (Closes[1][0] > rangeBarHigh)
  52. {
  53. rangeBarHigh = Closes[1][0];
  54. }
  55.  
  56. if (isNewBar)
  57. {
  58. rangeBarLow = Closes[1][0];
  59. rangeBarHigh = Closes[1][0];
  60. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement