TD Sequential
Count Tom DeMark’s TD Sequential for every ticker: the TD Setup of nine closes in a row beyond the close four bars earlier, and the TD Countdown to 13 that follows it.
DeMark designed it to find where a trend exhausts itself: a completed buy setup (nine lower closes) and above all a completed buy countdown (13) point to a low, a completed sell setup and countdown to a high.
The rules are DeMark’s:
- Price Flip: a buy setup starts on a close below the close four bars earlier right after a close above the close four bars before that one, a sell setup on the reverse.
- TD Buy Setup: from the flip on, every close below the close four bars earlier counts 1 to 9, and a close that is not below breaks it. The setup is complete on its ninth bar; the count then stops until the next flip. The TD Sell Setup counts closes above the close four bars earlier.
- TD Buy Countdown: starts on the bar that completes a buy setup and counts every bar, not necessarily in a row, that closes at or below the low two bars earlier, up to 13. The 13th bar also needs a low at or below the close of the eighth countdown bar, else the countdown waits at 12. The TD Sell Countdown counts closes at or above the high two bars earlier, its 13th bar a high at or above the close of the eighth.
- Cancellation: a buy countdown ends when a sell setup completes (which starts the sell countdown) or when a close rises above the TDST level of its setup, the highest true high (the high, or the previous close when higher) of its nine bars; a sell countdown ends on a completed buy setup or a close below the lowest true low of its setup.
TD Sequential, TD Setup, TD Countdown and TDST are Tom DeMark’s names for his indicator and its parts.
Also known as: TD Sequential, DeMark Sequential, Tom DeMark, TD Setup, TD Countdown, TDST, TD9, TD13, DeMark 9 13, td_seq.
Example · AAPL, MSFT · 2025
Install the Finance Toolkit with pip install financetoolkit -U, then call get_td_sequential:
from financetoolkit import Toolkit
toolkit = Toolkit(
["AAPL", "MSFT"],
api_key="FINANCIAL_MODELING_PREP_KEY",
start_date="2025-01-01",
end_date="2025-12-31",
)
td_sequential = toolkit.technicals.get_td_sequential()
td_sequential.xs("AAPL", level=1, axis="columns")
Or, with the Finance Toolkit MCP set up, ask an AI assistant such as Claude or ChatGPT:
What were Apple's TD Sequential setup and countdown counts in 2025?
Which returns:
| Date | Buy Setup | Sell Setup | Buy Countdown | Sell Countdown |
|---|---|---|---|---|
| 2025-01-02 | 3 | 0 | 0 | 0 |
| 2025-01-03 | 4 | 0 | 0 | 0 |
| 2025-01-06 | 5 | 0 | 0 | 0 |
| 2025-01-07 | 6 | 0 | 0 | 0 |
| 2025-01-08 | 7 | 0 | 0 | 0 |
| 2025-01-10 | 8 | 0 | 0 | 0 |
| 2025-01-13 | 9 | 0 | 1 | 0 |
| 2025-01-14 | 0 | 0 | 0 | 0 |
| 2025-01-15 | 0 | 0 | 0 | 0 |
| 2025-01-16 | 0 | 0 | 2 | 0 |
| 2025-01-17 | 0 | 0 | 3 | 0 |
| 2025-01-21 | 0 | 0 | 4 | 0 |
| 2025-01-22 | 0 | 0 | 5 | 0 |
| 2025-01-23 | 0 | 0 | 0 | 0 |
| 2025-01-24 | 0 | 0 | 0 | 0 |
| 2025-01-27 | 0 | 1 | 0 | 0 |
| 2025-01-28 | 0 | 2 | 0 | 0 |
| 2025-01-29 | 0 | 3 | 0 | 0 |
| 2025-01-30 | 0 | 4 | 0 | 0 |
| 2025-01-31 | 0 | 5 | 0 | 0 |
| 2025-02-03 | 1 | 0 | 6 | 0 |
| 2025-02-04 | 2 | 0 | 7 | 0 |
| 2025-02-05 | 3 | 0 | 0 | 0 |
| 2025-02-06 | 4 | 0 | 0 | 0 |
| 2025-02-07 | 5 | 0 | 8 | 0 |
| 2025-02-10 | 6 | 0 | 9 | 0 |
| 2025-02-11 | 0 | 1 | 0 | 0 |
| 2025-02-12 | 0 | 2 | 0 | 0 |
| 2025-02-13 | 0 | 3 | 0 | 0 |
| 2025-02-14 | 0 | 4 | 0 | 0 |
| 2025-02-18 | 0 | 5 | 0 | 0 |
| 2025-02-19 | 0 | 6 | 0 | 0 |
| 2025-02-20 | 0 | 7 | 0 | 0 |
| 2025-02-21 | 0 | 8 | 0 | 0 |
| 2025-02-24 | 0 | 9 | 0 | 1 |
| 2025-02-25 | 0 | 0 | 0 | 0 |
| 2025-02-26 | 1 | 0 | 0 | 0 |
| 2025-02-27 | 2 | 0 | 0 | 0 |
| 2025-02-28 | 3 | 0 | 0 | 0 |
| 2025-03-03 | 4 | 0 | 0 | 0 |
| 2025-03-04 | 5 | 0 | 0 | 0 |
| 2025-03-05 | 6 | 0 | 0 | 0 |
| 2025-03-06 | 7 | 0 | 0 | 0 |
| 2025-03-07 | 0 | 1 | 0 | 2 |
| 2025-03-10 | 1 | 0 | 0 | 0 |
| 2025-03-11 | 2 | 0 | 0 | 0 |
| 2025-03-12 | 3 | 0 | 0 | 0 |
| 2025-03-13 | 4 | 0 | 0 | 0 |
| 2025-03-14 | 5 | 0 | 0 | 0 |
| 2025-03-17 | 6 | 0 | 0 | 0 |
| 2025-03-18 | 7 | 0 | 0 | 0 |
| 2025-03-19 | 0 | 1 | 0 | 0 |
| 2025-03-20 | 0 | 2 | 0 | 0 |
| 2025-03-21 | 0 | 3 | 0 | 0 |
| 2025-03-24 | 0 | 4 | 0 | 0 |
| 2025-03-25 | 0 | 5 | 0 | 0 |
| 2025-03-26 | 0 | 6 | 0 | 0 |
| 2025-03-27 | 0 | 7 | 0 | 0 |
| 2025-03-28 | 1 | 0 | 0 | 0 |
| 2025-03-31 | 2 | 0 | 0 | 0 |
| 2025-04-01 | 0 | 1 | 0 | 0 |
| 2025-04-02 | 0 | 2 | 0 | 0 |
| 2025-04-03 | 1 | 0 | 0 | 0 |
| 2025-04-04 | 2 | 0 | 0 | 0 |
| 2025-04-07 | 3 | 0 | 0 | 0 |
| 2025-04-08 | 4 | 0 | 0 | 0 |
| 2025-04-09 | 5 | 0 | 0 | 0 |
| 2025-04-10 | 0 | 1 | 0 | 0 |
| 2025-04-11 | 0 | 2 | 0 | 0 |
| 2025-04-14 | 0 | 3 | 0 | 0 |
| 2025-04-15 | 0 | 4 | 0 | 0 |
| 2025-04-16 | 0 | 5 | 0 | 0 |
| 2025-04-17 | 1 | 0 | 0 | 0 |
| 2025-04-21 | 2 | 0 | 0 | 0 |
| 2025-04-22 | 3 | 0 | 0 | 0 |
| 2025-04-23 | 0 | 1 | 0 | 0 |
| 2025-04-24 | 0 | 2 | 0 | 0 |
| 2025-04-25 | 0 | 3 | 0 | 0 |
| 2025-04-28 | 0 | 4 | 0 | 0 |
| 2025-04-29 | 0 | 5 | 0 | 0 |
| 2025-04-30 | 0 | 6 | 0 | 0 |
| 2025-05-01 | 0 | 7 | 0 | 0 |
| 2025-05-02 | 1 | 0 | 0 | 0 |
| 2025-05-05 | 2 | 0 | 0 | 0 |
| 2025-05-06 | 3 | 0 | 0 | 0 |
| 2025-05-07 | 4 | 0 | 0 | 0 |
| 2025-05-08 | 5 | 0 | 0 | 0 |
| 2025-05-09 | 6 | 0 | 0 | 0 |
| 2025-05-12 | 0 | 1 | 0 | 0 |
| 2025-05-13 | 0 | 2 | 0 | 0 |
| 2025-05-14 | 0 | 3 | 0 | 0 |
| 2025-05-15 | 0 | 4 | 0 | 0 |
| 2025-05-16 | 0 | 5 | 0 | 0 |
| 2025-05-19 | 1 | 0 | 0 | 0 |
| 2025-05-20 | 2 | 0 | 0 | 0 |
| 2025-05-21 | 3 | 0 | 0 | 0 |
| 2025-05-22 | 4 | 0 | 0 | 0 |
| 2025-05-23 | 5 | 0 | 0 | 0 |
| 2025-05-27 | 6 | 0 | 0 | 0 |
| 2025-05-28 | 7 | 0 | 0 | 0 |
| 2025-05-29 | 8 | 0 | 0 | 0 |
| 2025-05-30 | 0 | 1 | 0 | 0 |
| 2025-06-02 | 0 | 2 | 0 | 0 |
| 2025-06-03 | 0 | 3 | 0 | 0 |
| 2025-06-04 | 0 | 4 | 0 | 0 |
| 2025-06-05 | 1 | 0 | 0 | 0 |
| 2025-06-06 | 0 | 1 | 0 | 0 |
| 2025-06-09 | 1 | 0 | 0 | 0 |
| 2025-06-10 | 2 | 0 | 0 | 0 |
| 2025-06-11 | 3 | 0 | 0 | 0 |
| 2025-06-12 | 4 | 0 | 0 | 0 |
| 2025-06-13 | 5 | 0 | 0 | 0 |
| 2025-06-16 | 6 | 0 | 0 | 0 |
| 2025-06-17 | 7 | 0 | 0 | 0 |
| 2025-06-18 | 8 | 0 | 0 | 0 |
| 2025-06-20 | 0 | 1 | 0 | 0 |
| 2025-06-23 | 0 | 2 | 0 | 0 |
| 2025-06-24 | 0 | 3 | 0 | 0 |
| 2025-06-25 | 0 | 4 | 0 | 0 |
| 2025-06-26 | 0 | 0 | 0 | 0 |
| 2025-06-27 | 0 | 0 | 0 | 0 |
| 2025-06-30 | 0 | 1 | 0 | 0 |
| 2025-07-01 | 0 | 2 | 0 | 0 |
| 2025-07-02 | 0 | 3 | 0 | 0 |
| 2025-07-03 | 0 | 4 | 0 | 0 |
| 2025-07-07 | 0 | 5 | 0 | 0 |
| 2025-07-08 | 0 | 6 | 0 | 0 |
| 2025-07-09 | 1 | 0 | 0 | 0 |
| 2025-07-10 | 2 | 0 | 0 | 0 |
| 2025-07-11 | 0 | 1 | 0 | 0 |
| 2025-07-14 | 1 | 0 | 0 | 0 |
| 2025-07-15 | 2 | 0 | 0 | 0 |
| 2025-07-16 | 3 | 0 | 0 | 0 |
| 2025-07-17 | 4 | 0 | 0 | 0 |
| 2025-07-18 | 0 | 1 | 0 | 0 |
| 2025-07-21 | 0 | 2 | 0 | 0 |
| 2025-07-22 | 0 | 3 | 0 | 0 |
| 2025-07-23 | 0 | 4 | 0 | 0 |
| 2025-07-24 | 0 | 5 | 0 | 0 |
| 2025-07-25 | 0 | 6 | 0 | 0 |
| 2025-07-28 | 1 | 0 | 0 | 0 |
| 2025-07-29 | 2 | 0 | 0 | 0 |
| 2025-07-30 | 3 | 0 | 0 | 0 |
| 2025-07-31 | 4 | 0 | 0 | 0 |
| 2025-08-01 | 5 | 0 | 0 | 0 |
| 2025-08-04 | 6 | 0 | 0 | 0 |
| 2025-08-05 | 7 | 0 | 0 | 0 |
| 2025-08-06 | 0 | 1 | 0 | 0 |
| 2025-08-07 | 0 | 2 | 0 | 0 |
| 2025-08-08 | 0 | 3 | 0 | 0 |
| 2025-08-11 | 0 | 4 | 0 | 0 |
| 2025-08-12 | 0 | 5 | 0 | 0 |
| 2025-08-13 | 0 | 6 | 0 | 0 |
| 2025-08-14 | 0 | 7 | 0 | 0 |
| 2025-08-15 | 0 | 8 | 0 | 0 |
| 2025-08-18 | 0 | 9 | 0 | 0 |
| 2025-08-19 | 1 | 0 | 0 | 0 |
| 2025-08-20 | 2 | 0 | 0 | 0 |
| 2025-08-21 | 3 | 0 | 0 | 0 |
| 2025-08-22 | 4 | 0 | 0 | 0 |
| 2025-08-25 | 5 | 0 | 0 | 1 |
| 2025-08-26 | 0 | 1 | 0 | 2 |
| 2025-08-27 | 0 | 2 | 0 | 3 |
| 2025-08-28 | 0 | 3 | 0 | 4 |
| 2025-08-29 | 0 | 4 | 0 | 5 |
| 2025-09-02 | 0 | 5 | 0 | 0 |
| 2025-09-03 | 0 | 6 | 0 | 6 |
| 2025-09-04 | 0 | 7 | 0 | 7 |
| 2025-09-05 | 0 | 8 | 0 | 8 |
| 2025-09-08 | 0 | 9 | 0 | 0 |
| 2025-09-09 | 1 | 0 | 0 | 0 |
| 2025-09-10 | 2 | 0 | 0 | 0 |
| 2025-09-11 | 3 | 0 | 0 | 0 |
| 2025-09-12 | 4 | 0 | 0 | 9 |
| 2025-09-15 | 0 | 1 | 0 | 10 |
| 2025-09-16 | 0 | 2 | 0 | 11 |
| 2025-09-17 | 0 | 3 | 0 | 12 |
| 2025-09-18 | 0 | 4 | 0 | 0 |
| 2025-09-19 | 0 | 5 | 0 | 13 |
| 2025-09-22 | 0 | 6 | 0 | 0 |
| 2025-09-23 | 0 | 7 | 0 | 0 |
| 2025-09-24 | 0 | 8 | 0 | 0 |
| 2025-09-25 | 0 | 9 | 0 | 0 |
| 2025-09-26 | 1 | 0 | 0 | 0 |
| 2025-09-29 | 0 | 0 | 0 | 0 |
| 2025-09-30 | 0 | 0 | 0 | 0 |
| 2025-10-01 | 1 | 0 | 0 | 1 |
| 2025-10-02 | 0 | 1 | 0 | 2 |
| 2025-10-03 | 0 | 2 | 0 | 0 |
| 2025-10-06 | 0 | 3 | 0 | 0 |
| 2025-10-07 | 0 | 4 | 0 | 0 |
| 2025-10-08 | 0 | 5 | 0 | 0 |
| 2025-10-09 | 1 | 0 | 0 | 0 |
| 2025-10-10 | 2 | 0 | 0 | 0 |
| 2025-10-13 | 3 | 0 | 0 | 0 |
| 2025-10-14 | 4 | 0 | 0 | 0 |
| 2025-10-15 | 5 | 0 | 0 | 0 |
| 2025-10-16 | 0 | 1 | 0 | 0 |
| 2025-10-17 | 0 | 2 | 0 | 3 |
| 2025-10-20 | 0 | 3 | 0 | 4 |
| 2025-10-21 | 0 | 4 | 0 | 5 |
| 2025-10-22 | 0 | 5 | 0 | 0 |
| 2025-10-23 | 0 | 6 | 0 | 0 |
| 2025-10-24 | 0 | 7 | 0 | 0 |
| 2025-10-27 | 0 | 8 | 0 | 6 |
| 2025-10-28 | 0 | 9 | 0 | 7 |
| 2025-10-29 | 0 | 0 | 0 | 8 |
| 2025-10-30 | 0 | 0 | 0 | 9 |
| 2025-10-31 | 0 | 0 | 0 | 0 |
| 2025-11-03 | 0 | 0 | 0 | 0 |
| 2025-11-04 | 0 | 0 | 0 | 0 |
| 2025-11-05 | 1 | 0 | 0 | 0 |
| 2025-11-06 | 2 | 0 | 0 | 0 |
| 2025-11-07 | 3 | 0 | 0 | 0 |
| 2025-11-10 | 4 | 0 | 0 | 0 |
| 2025-11-11 | 0 | 1 | 0 | 10 |
| 2025-11-12 | 0 | 2 | 0 | 0 |
| 2025-11-13 | 0 | 3 | 0 | 0 |
| 2025-11-14 | 0 | 4 | 0 | 0 |
| 2025-11-17 | 1 | 0 | 0 | 0 |
| 2025-11-18 | 2 | 0 | 0 | 0 |
| 2025-11-19 | 3 | 0 | 0 | 0 |
| 2025-11-20 | 4 | 0 | 0 | 0 |
| 2025-11-21 | 0 | 1 | 0 | 0 |
| 2025-11-24 | 0 | 2 | 0 | 11 |
| 2025-11-25 | 0 | 3 | 0 | 12 |
| 2025-11-26 | 0 | 4 | 0 | 13 |
| 2025-11-28 | 0 | 5 | 0 | 0 |
| 2025-12-01 | 0 | 6 | 0 | 0 |
| 2025-12-02 | 0 | 7 | 0 | 0 |
| 2025-12-03 | 0 | 8 | 0 | 0 |
| 2025-12-04 | 0 | 9 | 0 | 0 |
| 2025-12-05 | 1 | 0 | 0 | 0 |
| 2025-12-08 | 2 | 0 | 0 | 0 |
| 2025-12-09 | 3 | 0 | 0 | 0 |
| 2025-12-10 | 4 | 0 | 0 | 0 |
| 2025-12-11 | 5 | 0 | 0 | 0 |
| 2025-12-12 | 0 | 1 | 0 | 0 |
| 2025-12-15 | 1 | 0 | 0 | 0 |
| 2025-12-16 | 2 | 0 | 0 | 0 |
| 2025-12-17 | 3 | 0 | 0 | 0 |
| 2025-12-18 | 4 | 0 | 0 | 0 |
| 2025-12-19 | 5 | 0 | 0 | 0 |
| 2025-12-22 | 6 | 0 | 0 | 0 |
| 2025-12-23 | 0 | 1 | 0 | 0 |
| 2025-12-24 | 0 | 2 | 0 | 0 |
| 2025-12-26 | 1 | 0 | 0 | 1 |
| 2025-12-29 | 0 | 1 | 0 | 0 |
| 2025-12-30 | 0 | 2 | 0 | 0 |
| 2025-12-31 | 1 | 0 | 0 | 0 |
250 rows
Parameters
get_td_sequential accepts the following parameters.
| Parameter | Type | Description | Example |
|---|---|---|---|
period | str | The time period to consider for historical data. Options are: “intraday” (intraday prices), “daily” (daily prices), “weekly” (weekly prices), “monthly” (monthly prices), “quarterly” (quarterly prices), “yearly” (yearly prices). Defaults to “daily”. | "weekly" |
close_column | str | The column name for closing prices in the historical data. Defaults to “Adj Close”, in which case the high and low prices are adjusted for dividends in the same way. “Close” uses the prices as traded (split-adjusted). | "Close" |
show_columns | str | list[str] | None | The columns to keep, a name or a list of names, matched on every column level, or the rows when no column has those names (such as the line items of a financial statement). Names that do not exist are logged, and when none exist the result is returned in full. Defaults to None, which keeps every column. | None, which keeps every column |
References
- Paper DeMark, T.R. (1994). “The New Science of Technical Analysis.” Wiley.
- Paper Perl, J. (2008). “DeMark Indicators.” Bloomberg Press.
- Library Referenced against pandas-ta-classic’s td_seq