Skip to main content
On this page

Tom DeMark 9 on TradingView: Setup Counts and Pineify Behavior

· 5 min read
Pineify Team
Pine Script and AI trading workflow research team

A nine-bar Setup and a thirteen-count Countdown are different parts of DeMARK Sequential. Calling a second nine-count phase the official Countdown is incorrect. Pineify's Tom Demark 9 component implements consecutive comparisons with the close four bars earlier; it is not the complete DeMARK Sequential study.

TD9 Chart

Setup 9 is different from Countdown 13​

The DeMARK-authored 9-13 description distinguishes a nine-bar Setup from a separate thirteen-count Countdown. A Buy Setup uses consecutive closes below the close four bars earlier; a Sell Setup uses closes above it. The subsequent Sequential Countdown uses different comparisons and need not be consecutive. The official study also includes qualifications that a simple close-comparison counter does not reproduce.

DeMARK and related names identify their respective methodology and products. This explanation does not claim Pineify's component is an official or licensed equivalent.

What Pineify actually counts​

Pineify exposes two numeric outputs:

OutputIncrement conditionReset condition
Up CountCurrent close is strictly above the close four bars earlierComparison is false or historical reference is unavailable
Down CountCurrent close is strictly below the close four bars earlierComparison is false or historical reference is unavailable

Equality resets both counters. Counts can continue above nine; the function does not stop at nine or start a separate thirteen-count phase. It also does not require an explicit price-flip qualification before beginning a run.

The configuration includes an input named N with default 15, but the current counting function does not use that argument. Changing it therefore does not change these comparisons or their count target. This is an implementation limitation, not a tunable lookback described by the article.

Read the labels with their creation time in mind​

The current drawing routine begins creating labels when a counter is at least six. It loops over the sequence and draws numbers up to nine at earlier bar positions. On subsequent qualifying bars it can create additional labels for those positions. The visible history therefore includes labels added retrospectively; a number drawn over an earlier candle is not proof that it was available on that candle.

Up-count labels appear above bars, primarily in fuchsia, with nine green. Down-count labels appear below bars, primarily green, with nine fuchsia. These display colors do not independently encode a trade recommendation. Drawing objects and retained history are also subject to TradingView's limits.

The calculation uses the current close without an explicit confirmed-bar gate in this component. A developing bar can change the comparison. For an alert or strategy condition, specify whether to wait for the bar to close and verify the result after reload.

Add and inspect the component​

Pineify Website

Use Pineify's Visual Editor to select Tom Demark 9, generate the configured source, and review it in TradingView's Pine Editor. Compare the numeric outputs with a short hand-counted run on standard candles. Include an equal-close case, a broken sequence, a run beyond nine, and a developing live bar.

Inspect the latest numeric count separately from retrospective labels. If a test is intended to trigger only at the ninth count, use an exact ninth-count condition rather than every bar whose count is at least nine. That is an example of defining a rule, not a tested trading edge.

Turning a count into an experiment​

A count alone does not define direction, entry timing, risk, or exit. A reversal hypothesis and a continuation hypothesis require separate rules. Define the confirmation event, order timing, sizing, costs, and exit before comparing historical results. Keep the period used for evaluation separate from the period used to select parameters.

No win rate, typical reversal size, signal-frequency table, or best timeframe is established here. Strong trends may continue after nine comparisons, and a visually compelling historical turn does not quantify predictive reliability.

Is TD9 the Countdown phase of TD Sequential?

No. Nine is associated with Setup; the official Sequential Countdown is a separate thirteen-count process. Pineify's TD9 component is a simpler consecutive close-comparison counter.

Does changing N change the Pineify calculation?

Not in the current implementation. The argument is exposed but unused by the counting function.

Were all historical labels visible in real time?

No such assumption is safe. The current drawing routine adds earlier sequence labels once the count reaches six, and can draw them again on later bars.

Does a nine guarantee a reversal?

No. It records a completed count condition; a trading rule and its results require separate testing.

The Best Pine Script Generator