Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Something that helps me with my trades.
- // Trade after countdown reaches 13 after the perfection of a buy or sell Setup.
- // Perhaps still some errors included. I am going through the documentation so better versions should follow.
- // Jan de Korver
- // TD & Sequential Countdown
- //
- // 11 Nov 2017
- study("TD & Sequential Countdown", overlay=true)
- Count=close>close[4]?1:0
- 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
- Counta=close<close[4]?1:0
- 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
- piepb=Count1==9 and piepb[1]==0?1:piepb[1]>0?piep2[1]==13?0:nz(piepb[1])+1:0
- 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]
- piepa=Count2==9 and piepa[1]==0?1:piepa[1]>0?piep[1]==13?0:nz(piepa[1])+1:0
- 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]
- plotchar(Count1==1,char='1', color=lime)
- plotchar(Count1==2,char='2', color=lime)
- plotchar(Count1==3,char='3', color=lime)
- plotchar(Count1==4,char='4', color=lime)
- plotchar(Count1==5,char='5', color=lime)
- plotchar(Count1==6,char='6', color=lime)
- plotchar(Count1==7,char='7', color=lime)
- plotchar(Count1==8,char='8', color=lime)
- plotchar(Count1==9,char='9', color=lime)
- plotchar(Count2==1,char='1', color=red)
- plotchar(Count2==2,char='2', color=red)
- plotchar(Count2==3,char='3', color=red)
- plotchar(Count2==4,char='4', color=red)
- plotchar(Count2==5,char='5', color=red)
- plotchar(Count2==6,char='6', color=red)
- plotchar(Count2==7,char='7', color=red)
- plotchar(Count2==8,char='8', color=red)
- plotchar(Count2==9,char='9', color=red)
- plotshape(piep==1 and piep[1]==0?1: na, text='1', location=location.belowbar, style=shape.triangledown, color=red)
- plotshape(piep==2 and piep[1]==1?1: na, text='2', location=location.belowbar, style=shape.triangledown, color=red)
- plotshape(piep==3 and piep[1]==2?1: na, text='3', location=location.belowbar, style=shape.triangledown, color=red)
- plotshape(piep==4 and piep[1]==3?1: na, text='4', location=location.belowbar, style=shape.triangledown, color=red)
- plotshape(piep==5 and piep[1]==4?1: na, text='5', location=location.belowbar, style=shape.triangledown, color=red)
- plotshape(piep==6 and piep[1]==5?1: na, text='6', location=location.belowbar, style=shape.triangledown, color=red)
- plotshape(piep==7 and piep[1]==6?1: na, text='7', location=location.belowbar, style=shape.triangledown, color=red)
- plotshape(piep==8 and piep[1]==7?1: na, text='8', location=location.belowbar, style=shape.triangledown, color=red)
- plotshape(piep==9 and piep[1]==8?1: na, text='9', location=location.belowbar, style=shape.triangledown, color=red)
- plotshape(piep==10 and piep[1]==9?1: na, text='10', location=location.belowbar, style=shape.triangledown, color=red)
- plotshape(piep==11 and piep[1]==10?1: na, text='11', location=location.belowbar, style=shape.triangledown, color=red)
- plotshape(piep==12 and piep[1]==11?1: na, text='12', location=location.belowbar, style=shape.triangledown, color=red)
- plotshape(piep==13 and piep[1]==12?1: na, text='13', location=location.belowbar, style=shape.triangledown, color=red)
- // 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)
- plotshape(piep2==1 and piep2[1]==0?1: na, text='1', location=location.belowbar, style=shape.triangleup, color=lime)
- plotshape(piep2==2 and piep2[1]==1?1: na, text='2', location=location.belowbar, style=shape.triangleup, color=lime)
- plotshape(piep2==3 and piep2[1]==2?1: na, text='3', location=location.belowbar, style=shape.triangleup, color=lime)
- plotshape(piep2==4 and piep2[1]==3?1: na, text='4', location=location.belowbar, style=shape.triangleup, color=lime)
- plotshape(piep2==5 and piep2[1]==4?1: na, text='5', location=location.belowbar, style=shape.triangleup, color=lime)
- plotshape(piep2==6 and piep2[1]==5?1: na, text='6', location=location.belowbar, style=shape.triangleup, color=lime)
- plotshape(piep2==7 and piep2[1]==6?1: na, text='7', location=location.belowbar, style=shape.triangleup, color=lime)
- plotshape(piep2==8 and piep2[1]==7?1: na, text='8', location=location.belowbar, style=shape.triangleup, color=lime)
- plotshape(piep2==9 and piep2[1]==8?1: na, text='9', location=location.belowbar, style=shape.triangleup, color=lime)
- plotshape(piep2==10 and piep2[1]==9?1: na, text='10', location=location.belowbar, style=shape.triangleup, color=lime)
- plotshape(piep2==11 and piep2[1]==10?1: na, text='11', location=location.belowbar, style=shape.triangleup, color=lime)
- plotshape(piep2==12 and piep2[1]==11?1: na, text='12', location=location.belowbar, style=shape.triangleup, color=lime)
- 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