TD Supply & Demand Points Pine Script — Complete TradingView Guide

The TD Supply & Demand Points indicator is a Pine Script v6 overlay tool for TradingView that automatically marks price bars where buying demand or selling supply has historically exhausted, creating potential reversal zones. Developed within Tom DeMark's TD Sequential methodology, the indicator uses two pattern levels: a lightweight 3-candle Level 1 pattern and a stricter 5-candle Level 2 pattern. Supply points — bars where price peaked — are marked with a red X above the bar; demand points — bars where price bottomed — are marked with a green X below the bar. The indicator works across stocks, crypto, forex, and futures on any timeframe from 5-minute intraday charts to the Daily. With Pineify, you can generate, customize, and download a complete runnable TD Supply & Demand Points Pine Script file in under 30 seconds without writing code manually.

What Is the TD Supply & Demand Points Indicator?

The TD Supply & Demand Points indicator is a price-structure pattern detector that identifies candlestick formations where supply (selling pressure) or demand (buying pressure) has historically reversed the trend, used to mark potential high-probability reversal zones on a TradingView chart. The methodology originates from Tom DeMark's work in the 1970s and 1980s, formalised in his 1994 book The New Science of Technical Analysis. DeMark developed a family of "TD" indicators based on price exhaustion patterns rather than lagging averages, and the Supply & Demand Points form the foundational identification layer for his TD Sequential and TD Combo systems.

Level 1 Supply Point formula (3-candle pattern): A supply point forms when high[1] > high[2] AND high[1] > high[0] — the middle bar's high exceeds both the bar before it and the bar after it, confirming a local peak. The Level 1 Demand Point is the inverse: low[1] < low[2] AND low[1] < low[0].

Level 2 Supply Point formula (5-candle pattern): A stricter pattern requiring a descending sequence of highs: high[2] > high[3] AND high[3] > high[4] AND high[2] > high[1] AND high[1] > high[0]. Each variable represents the closing price of a bar offset by the bracket index from the current bar. Level 2 patterns confirm a more sustained exhaustion move and produce fewer but higher-confidence signals.

Applicable markets: The indicator applies to any liquid market with reliable OHLC data — US equities (NYSE, NASDAQ), cryptocurrencies (BTC, ETH, altcoins), forex major pairs (EUR/USD, GBP/USD), and futures (ES, NQ, CL). It is not suitable for illiquid assets where large price gaps break the sequential candle logic.

Best timeframes: Level 1 patterns work well on 5-minute to 15-minute charts for scalping and intraday momentum traders. Level 1 on 1H–4H suits swing traders seeking moderate frequency. Level 2 on the Daily or Weekly timeframe provides the highest signal reliability for position traders. Avoid applying this indicator on timeframes below 1 minute where candle formation noise dominates.

In Pine Script v6, the indicator is implemented with the plotshape() function using location.abovebar for supply points (red X) and location.belowbar for demand points (green X). The overlay=true parameter ensures markers appear directly on the price chart rather than in a separate pane, making it easy to see supply and demand zones in the context of price action.

TD Supply & Demand Points Pine Script Code Example

The following Pine Script v6 code implements the complete TD Supply & Demand Points indicator with both Level 1 (3-candle) and Level 2 (5-candle) pattern detection. To use it in TradingView, open the Pine Editor (keyboard shortcut Alt+P), paste the code, click Add to chart, and supply points (red X) and demand points (green X) will appear immediately on your price chart.

// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © Pineify

//@version=6
indicator(title="TD Supply & Demand Points", overlay=true, max_labels_count=500)

// TD Supply & Demand Points — identifies price levels where supply or demand flips
p_ta_td_supply_demand_points(simple int patternLevel) =>
    // Level 1: 3-candle pattern
    isSupplyPoint_L1 = high[1] > high[2] and high[1] > high
    isDemandPoint_L1 = low[1] < low[2] and low[1] < low

    // Level 2: 5-candle pattern
    isSupplyPoint_L2 = high[2] > high[3] and high[3] > high[4] and high[2] > high[1] and high[1] > high
    isDemandPoint_L2 = low[2] < low[3] and low[3] < low[4] and low[2] < low[1] and low[1] < low

    isSupplyPoint = patternLevel == 1 ? isSupplyPoint_L1 : isSupplyPoint_L2
    isDemandPoint = patternLevel == 1 ? isDemandPoint_L1 : isDemandPoint_L2

    supplyPointL1 = isSupplyPoint_L1 and patternLevel == 1
    demandPointL1 = isDemandPoint_L1 and patternLevel == 1
    supplyPointL2 = isSupplyPoint_L2 and patternLevel == 2
    demandPointL2 = isDemandPoint_L2 and patternLevel == 2

    [supplyPointL1, demandPointL1, supplyPointL2, demandPointL2]

[p_ind_1_supplyPointL1, p_ind_1_demandPointL1, p_ind_1_supplyPointL2, p_ind_1_demandPointL2] = p_ta_td_supply_demand_points(1)

// Plot supply points above the bar (red X) and demand points below (green X)
plotshape(p_ind_1_supplyPointL1, title="Supply Point L1", location=location.abovebar, color=color.rgb(255, 0, 0), style=shape.xcross, size=size.tiny, offset=-1)
plotshape(p_ind_1_demandPointL1, title="Demand Point L1", location=location.belowbar, color=color.rgb(0, 255, 0), style=shape.xcross, size=size.tiny, offset=-1)
plotshape(p_ind_1_supplyPointL2, title="Supply Point L2", location=location.abovebar, color=color.rgb(255, 0, 0), style=shape.xcross, size=size.tiny, offset=-2)
plotshape(p_ind_1_demandPointL2, title="Demand Point L2", location=location.belowbar, color=color.rgb(0, 255, 0), style=shape.xcross, size=size.tiny, offset=-2)
TD Supply & Demand Points indicator Pine Script code example in TradingView

TD Supply & Demand Points Parameters

The TD Supply & Demand Points indicator has one primary configuration parameter controlling which pattern level is active, plus visual display settings for the plotshape markers.

ParameterDefault ValueDescriptionRecommended Range
patternLevel1Pattern strictness level. 1 = 3-candle pattern (more signals); 2 = 5-candle pattern (fewer, higher-confidence signals).1 (intraday) or 2 (swing/position)
Supply colorRed (255, 0, 0)Color of the X cross marker plotted above supply point bars.Any high-contrast color visible on chart background
Demand colorGreen (0, 255, 0)Color of the X cross marker plotted below demand point bars.Any high-contrast color visible on chart background
sizesize.tinyVisual size of the plotshape marker on the chart.size.tiny – size.normal
offset-1 (L1), -2 (L2)Horizontal bar offset for the plotshape. Negative offset places the marker on the pattern's pivot bar rather than the current bar.Keep at default to align marker with actual pivot bar
Tuning scenarios:
  • Scalping (1–5 min): Use patternLevel = 1 with size.tiny to maximise signal frequency without cluttering the chart.
  • Swing trading (1H–4H): Use patternLevel = 1 but confirm each signal with RSI below 40 (demand) or above 60 (supply) to filter noise.
  • Position trading (Daily+): Use patternLevel = 2 for the strictest signals; increase marker size to size.small for visibility on zoomed-out charts.

TD Supply & Demand Points Trading Strategies

Strategy 1 — Demand Zone Reversal (Trending Markets)

Best for: Uptrending markets on 1H–Daily timeframes. Combines TD Demand Point with RSI for confirmation.

  1. Identify a green X demand point marker appearing below a bar on the chart.
  2. Confirm the demand zone by checking RSI (14-period) is below 40 at the time of the demand point bar.
  3. Wait for the next bar to close as a bullish candle (close above open) before entering long.
  4. Place a stop-loss 0.5 ATR below the demand point bar's low.
  5. Set a take-profit at the nearest supply point (red X) visible on the chart, or use a 2:1 reward-to-risk ratio.
  6. Exit immediately if price closes below the stop-loss level.

Strategy 2 — Supply Zone Short (Ranging Markets)

Best for: Ranging or distribution markets. Pairs TD Supply Point with MACD to filter direction.

  1. Identify a red X supply point marker appearing above a bar on the chart (Level 1 or Level 2).
  2. Confirm bearish momentum: MACD line must be below the signal line at the supply point bar.
  3. Wait for the next bar to close as a bearish candle (close below open) before entering short.
  4. Place a stop-loss 0.5 ATR above the supply point bar's high.
  5. Target the nearest demand point (green X) below, or a minimum 2:1 reward-to-risk ratio.
  6. Close the trade if price closes above the supply zone on any subsequent bar.

Strategy 3 — Supply-to-Demand Breakout (Level 2 Only)

Best for: Strong trending markets on 4H–Daily charts using Level 2 patterns only.

  1. Switch patternLevel to 2 to display only the strictest 5-candle supply/demand formations.
  2. In an uptrend (price above 200 EMA), enter long when price pulls back to a Level 2 demand zone and touches the demand point bar's low.
  3. Add a Bollinger Bands confirmation: enter only if price touches the lower band at the demand zone simultaneously.
  4. Set stop-loss 1 ATR below the demand bar low; target the upper Bollinger Band.
  5. Do not enter if more than 3 bars have elapsed since the demand point formed — stale zones lose predictive value.
Disclaimer: The strategies above are for educational purposes only. They do not constitute investment advice. Past performance of any pattern or strategy does not guarantee future results. Always conduct your own research and consider your risk tolerance before trading.

How to Generate TD Supply & Demand Points Pine Script in Pineify

Pineify generates a complete, runnable TD Supply & Demand Points Pine Script v6 file in under 30 seconds. Follow these five steps:

  1. 1

    Open Pineify

    Navigate to pineify.app in your browser and sign in or create a free account to access the indicator generator.

  2. 2

    Click "Add Indicator"

    From the main dashboard, click "Add Indicator" and search for "TD Supply & Demand Points" in the indicator library.

  3. 3

    Describe your configuration

    Select your preferred pattern level (1 for 3-candle or 2 for 5-candle), choose supply and demand marker colors, and adjust marker size.

  4. 4

    Copy the generated Pine Script

    Pineify outputs clean Pine Script v6 code. Click "Copy" to copy the complete runnable script to your clipboard.

  5. 5

    Adjust and apply in TradingView

    Open TradingView Pine Editor (Alt+P), paste the code, click "Add to chart," and the TD Supply & Demand Points markers appear immediately on your price chart.

Frequently Asked Questions

Start Using TD Supply & Demand Points Today

Generate your custom Pine Script indicator in under 30 seconds. No coding required.

Get Started Free