If u have afl/pinescript for TD set up for trading view pls share...
study("Demark", 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
iepb[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
iep2[1]==13?0
iep2[1]
piepa=Count2==9 and piepa[1]==0?1
iepa[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
iep[1]==13?0
iep[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)
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)