TD Sequential (Setup and Countdown)

There are several variations on the classic TD Sequential indicator already published so why do another one would be a fair question to ask. Personally i wasn't fully satisfied with how many of them were implemented so i decided to code my own version from the ground up guided by the rules outlined in Jason Perl's: DeMark Indicators book. Thanks to /u/glaz and /u/andyhitchman for their code that helped me start in the right direction.

Some of the potential improvements were:

Properly implemented setup trend lines
- they now represent the extreme of the beginning of the setup instead of the end

Visual clarity
- arrows appear only on setup nines and countdown thirteens
- indicator features clean simple numbers that (mostly) shrink when zoomed out

Proper and mostly complete countdown recycle and cancellation rules
- countdown is completed only when bar 13 is more extreme than bar 8, until that happens a plus sign (+) appears where 13 should have been
- countdown is cancelled if a setup is completed in the opposite direction, or the price trades through the relevant setup trend line with it's whole bar
- countdown is recycled (begins anew) if the price generates a new setup in the same direction that is greater than the previous one, but less than 1.618 it's size, or if that new setup pierces through the previous setup's true range on a closing basis

- By default setup initiation requires a price flip but if you like you can disable that requirement and recycle the setup after a nine
- You can now choose to track only buy or only sell setups or disable setups entirely
- You can display only completed nines while the rest are not showing
- Turn off or on support and/or resistance lines
- Turn off or on display of buy and/or sell countdowns
- More to come...

I coded the indicator with readability in mind hoping to make correcting and improving it easier so we can make the best Sequential indicator on TV. Efficiency wasn't too big a concern. Work is in progress and I'm planning to add more features.

Please PM me or comment below all your suggestions and requests, and especially the bugs if you find some.
Release Notes: Added risk lines for the countdown part. Still not sure where to cut them off when the market goes in your favor so they can get extended really long, will fix.
Ta bort från favoritskript Lägg till som favoritskript


Are you still polishing/improving this script? I have tested multiple versions and this one ended by being my selected to stay - thank you for it and congrats! :) The clean view of the indicator and customizations offered make it easy to see what/when we can without polluting the chart. Given that scenario, it would be great to see it going further, as the remaining of TD definitions (as combos, aggressive and so on)
+6 Svara
@Yngvar , if you are actively supporting this excellent script of yours, I have few bugs to report. Will report them once I receive your reply. I am an avid Demark follower, with fair understanding of the subject but no knowledge of pine script. Thanks for by far the best executed script on TV based on sequential.
+1 Svara
Yngvar vivek_ahuja
@vivek_ahuja, Hey vivek, thank you very much for your comment. I am not actively supporting it but would definitely like to hear your suggestions for improvement. Feel free to message me privately.
I can see that 9P is the perfection scenario, but what is the difference between the 9 and the 9 with the arrow?
+1 Svara
Yngvar derzzycharts
@derzzycharts, Well if i remember correctly every nine should have an arrow for the sake of visual clarity (to make them easier to spot), and the P is there to distinguish setup perfection as you correctly observed.
I'm reading through the same book and started improving on some of the existing scripts on TradingView, then I found this. On first glance it seems well done. Will try it out for a while and check it against the book. Thanks!
Yngvar GravityWave
@rass, Thank you for your comment. I think it's correct up to the point where the instructions in the book felt ambiguous to me, but maybe you can figure out some things out and we can improve it. Keep me posted.
@Yngvar, Will do! One thing I'm noticing already is the absence of TD setup counts spanning several bars, and I'm not sure I understand why. Any idea? Example:
+1 Svara
GravityWave GravityWave
Oh my bad, it was related to the price flip requirement; great that you put that in there.
Hem Aktie-screener Forex-screener Krypto-screener Ekonomisk kalender Hur det fungerar Diagramfunktioner Priser Tipsa en vän Ordningsregler Hjälpcenter Webbsidor och mäklarlösningar Widgets Diagramlösningar Lightweight Charting Library Blogg och nyheter Twitter
Profil Profilinställningar Konto och fakturering Hänvisade vänner Mynt Mina kölappar Hjälpcenter Publicerade idéer Följare Följer Privata meddelanden Chatt Logga ut