Vaginaldo

Untitled

Nov 11th, 2017
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.97 KB | None | 0 0
  1.  
  2. // Something that helps me with my trades.
  3.  
  4. // Trade after countdown reaches 13 after the perfection of a buy or sell Setup.
  5.  
  6. // Perhaps still some errors included. I am going through the documentation so better versions should follow.
  7.  
  8. // Jan de Korver
  9.  
  10.  
  11. // TD & Sequential Countdown
  12. //
  13. // 11 Nov 2017
  14.  
  15. study("TD & Sequential Countdown", overlay=true)
  16.  
  17. Count=close>close[4]?1:0
  18. Count1=Count==1?nz(Count1[1])==0?1:Count1[1]==1?2:Count1[1]==2?3:Count1[1]==3?4:Count1[1]==4?5:Count1[1]==5?6:Count1[1]==6?7:Count1[1]==7?8:Count1[1]==8?9:0:0
  19.  
  20. Counta=close<close[4]?1:0
  21. Count2=Counta==1?nz(Count2[1])==0?1:Count2[1]==1?2:Count2[1]==2?3:Count2[1]==3?4:Count2[1]==4?5:Count2[1]==5?6:Count2[1]==6?7:Count2[1]==7?8:Count2[1]==8?9:0:0
  22.  
  23. piepb=Count1==9 and piepb[1]==0?1:piepb[1]>0?piep2[1]==13?0:nz(piepb[1])+1:0
  24. piep2=piepb>0 and close>high[2] and close>high[1]?piep2[1]==13?0:nz(piep2[1])+1:piep2[1]==13?0:piep2[1]
  25.  
  26.  
  27.  
  28. piepa=Count2==9 and piepa[1]==0?1:piepa[1]>0?piep[1]==13?0:nz(piepa[1])+1:0
  29. piep=piepa>0 and close<low[2] and close<low[1]?piep[1]==13?0:nz(piep[1])+1:piep[1]==13?0:piep[1]
  30.  
  31.  
  32. plotchar(Count1==1,char='1', color=lime)
  33. plotchar(Count1==2,char='2', color=lime)
  34. plotchar(Count1==3,char='3', color=lime)
  35. plotchar(Count1==4,char='4', color=lime)
  36. plotchar(Count1==5,char='5', color=lime)
  37. plotchar(Count1==6,char='6', color=lime)
  38. plotchar(Count1==7,char='7', color=lime)
  39. plotchar(Count1==8,char='8', color=lime)
  40. plotchar(Count1==9,char='9', color=lime)
  41.  
  42. plotchar(Count2==1,char='1', color=red)
  43. plotchar(Count2==2,char='2', color=red)
  44. plotchar(Count2==3,char='3', color=red)
  45. plotchar(Count2==4,char='4', color=red)
  46. plotchar(Count2==5,char='5', color=red)
  47. plotchar(Count2==6,char='6', color=red)
  48. plotchar(Count2==7,char='7', color=red)
  49. plotchar(Count2==8,char='8', color=red)
  50. plotchar(Count2==9,char='9', color=red)
  51. plotshape(piep==1 and piep[1]==0?1: na, text='1', location=location.belowbar, style=shape.triangledown, color=red)
  52. plotshape(piep==2 and piep[1]==1?1: na, text='2', location=location.belowbar, style=shape.triangledown, color=red)
  53. plotshape(piep==3 and piep[1]==2?1: na, text='3', location=location.belowbar, style=shape.triangledown, color=red)
  54. plotshape(piep==4 and piep[1]==3?1: na, text='4', location=location.belowbar, style=shape.triangledown, color=red)
  55. plotshape(piep==5 and piep[1]==4?1: na, text='5', location=location.belowbar, style=shape.triangledown, color=red)
  56. plotshape(piep==6 and piep[1]==5?1: na, text='6', location=location.belowbar, style=shape.triangledown, color=red)
  57. plotshape(piep==7 and piep[1]==6?1: na, text='7', location=location.belowbar, style=shape.triangledown, color=red)
  58. plotshape(piep==8 and piep[1]==7?1: na, text='8', location=location.belowbar, style=shape.triangledown, color=red)
  59. plotshape(piep==9 and piep[1]==8?1: na, text='9', location=location.belowbar, style=shape.triangledown, color=red)
  60. plotshape(piep==10 and piep[1]==9?1: na, text='10', location=location.belowbar, style=shape.triangledown, color=red)
  61. plotshape(piep==11 and piep[1]==10?1: na, text='11', location=location.belowbar, style=shape.triangledown, color=red)
  62. plotshape(piep==12 and piep[1]==11?1: na, text='12', location=location.belowbar, style=shape.triangledown, color=red)
  63. plotshape(piep==13 and piep[1]==12?1: na, text='13', location=location.belowbar, style=shape.triangledown, color=red)
  64. // when you want to plot same two items plotshape(piep==13 and piep[1]==12?low*0.85: na, text='13', location=location.absolute, style=shape.triangledown, color=lime)
  65. plotshape(piep2==1 and piep2[1]==0?1: na, text='1', location=location.belowbar, style=shape.triangleup, color=lime)
  66. plotshape(piep2==2 and piep2[1]==1?1: na, text='2', location=location.belowbar, style=shape.triangleup, color=lime)
  67. plotshape(piep2==3 and piep2[1]==2?1: na, text='3', location=location.belowbar, style=shape.triangleup, color=lime)
  68. plotshape(piep2==4 and piep2[1]==3?1: na, text='4', location=location.belowbar, style=shape.triangleup, color=lime)
  69. plotshape(piep2==5 and piep2[1]==4?1: na, text='5', location=location.belowbar, style=shape.triangleup, color=lime)
  70. plotshape(piep2==6 and piep2[1]==5?1: na, text='6', location=location.belowbar, style=shape.triangleup, color=lime)
  71. plotshape(piep2==7 and piep2[1]==6?1: na, text='7', location=location.belowbar, style=shape.triangleup, color=lime)
  72. plotshape(piep2==8 and piep2[1]==7?1: na, text='8', location=location.belowbar, style=shape.triangleup, color=lime)
  73. plotshape(piep2==9 and piep2[1]==8?1: na, text='9', location=location.belowbar, style=shape.triangleup, color=lime)
  74. plotshape(piep2==10 and piep2[1]==9?1: na, text='10', location=location.belowbar, style=shape.triangleup, color=lime)
  75. plotshape(piep2==11 and piep2[1]==10?1: na, text='11', location=location.belowbar, style=shape.triangleup, color=lime)
  76. plotshape(piep2==12 and piep2[1]==11?1: na, text='12', location=location.belowbar, style=shape.triangleup, color=lime)
  77. plotshape(piep2==13 and piep2[1]==12?1: na, text='13', location=location.belowbar, style=shape.triangleup, color=lime)
Add Comment
Please, Sign In to add comment