# Supply Demand Edge

> Spot $TICK and $ADSPD supply/demand imbalances. Identify divergences in market internals for trading opportunities.

Page: https://tosindicators.com/indicators/supply-demand-edge  
Video: https://www.youtube.com/watch?v=RNtsjfHYWfs  
Section: Indicators  
Skill: Beginner-Friendly  
Access: free  
Updated: 2026-02-12

## Build a Supply Demand Edge Indicator for Market Imbalance Detection


Discover how to create a powerful Supply Demand Edge indicator that spots market imbalances before they become obvious to other traders using NYSE TICK and Advance/Decline divergence analysis.


This comprehensive tutorial teaches you to build an indicator featuring:




- NYSE TICK divergence detection for buying/selling pressure analysis

- Advance/Decline spread divergence identification

- High-of-day and low-of-day tracking with regular session logic

- Visual arrow signals for both long and short opportunities

- Customizable display options for TICK and A/D signals

- Extended hours compatibility


Perfect for traders looking to identify reversal opportunities in overbought/oversold zones or when combined with volatility-based indicators like the Volatility Box models. Note: This Supply Demand Edge indicator is distinct from the Edge Signals indicator, which serves as an advanced overbought/oversold confirmation tool exclusively available to Volatility Box members.

## Supply Demand Edge Indicator for ThinkOrSwim


Market timing often comes down to understanding one fundamental concept: supply and demand imbalances. When these imbalances occur, they create high-probability trading opportunities for those who can identify them early. The Supply Demand Edge indicator transforms this concept into a systematic approach by detecting divergences between price action and underlying market breadth data.


This sophisticated indicator analyzes two critical market breadth components - the NYSE TICK and Advance/Decline spread - to identify when institutional buying or selling pressure diverges from what price action suggests. These divergences often precede significant reversals, giving traders an edge in timing their entries and exits.



## Understanding Market Breadth and Supply/Demand Dynamics


The stock market operates as a massive marketplace where buyers and sellers continuously interact. Our primary objective as traders is determining whether we're in a buyer's market or seller's market, then positioning ourselves accordingly. However, surface-level price movements often mask the underlying supply and demand dynamics that truly drive market direction.


Market breadth analysis provides the solution by examining the internal mechanics of market movement. Unlike price-based indicators that only show the result of buying and selling activity, breadth indicators reveal the actual process of accumulation and distribution as it occurs.


The Supply Demand Edge indicator focuses on two specific breadth measures that provide complementary insights into market dynamics. The NYSE TICK measures immediate buying and selling pressure by tracking stocks trading on upticks versus downticks. The Advance/Decline spread reveals the overall participation level by counting advancing stocks versus declining stocks.


When these breadth measures diverge from price action, they often signal that the current trend is losing momentum and a reversal may be imminent. This divergence-based approach provides early warning signals that price-only analysis typically misses.



## The Power of NYSE TICK Analysis


The NYSE TICK represents one of the most powerful real-time sentiment indicators available to traders. It measures the number of NYSE-listed stocks whose last trade occurred on an uptick minus those whose last trade occurred on a downtick. This calculation provides immediate insight into whether buying or selling pressure dominates the market at any given moment.


In normal market conditions, we expect TICK readings to align with price movement. During strong uptrends, TICK values should remain predominantly positive, reflecting sustained buying pressure. Conversely, during downtrends, negative TICK readings should persist as selling pressure overwhelms buying interest.


However, divergences create the most profitable opportunities. When prices make new highs but TICK readings fail to confirm by reaching new highs, it suggests that buying pressure is waning despite the price advance. Similarly, when prices make new lows but TICK readings improve (become less negative), it indicates that selling pressure is diminishing even as prices continue to decline.


The Supply Demand Edge indicator automates this divergence detection process by comparing current TICK levels to the day's high and low TICK readings whenever price reaches new daily highs or lows. This systematic approach eliminates the need for manual chart monitoring while ensuring that no significant divergences are missed.



## Advance/Decline Spread Divergence Analysis


While TICK data provides insight into immediate buying and selling pressure, the Advance/Decline spread offers a broader perspective on market participation. This measure compares the number of advancing stocks to declining stocks, revealing whether market movements reflect broad-based participation or are driven by a limited number of issues.


Healthy trends typically display strong Advance/Decline participation. During genuine bull markets, we expect to see more stocks advancing than declining, supporting the upward price movement. Conversely, legitimate bear markets should show more declining stocks than advancing ones, confirming the downward price trend.


Divergences in Advance/Decline data often precede major trend changes. When major indices make new highs but fewer stocks participate in the advance (advance/decline spread weakens), it suggests that the rally lacks broad-based support and may be vulnerable to reversal. Similarly, when indices make new lows but the decline/advance spread improves, it indicates that the selling pressure is becoming more selective rather than broad-based.


The Supply Demand Edge indicator tracks these divergences by monitoring the Advance/Decline spread's daily highs and lows relative to price action. When price reaches new daily extremes but the A/D spread fails to confirm, the indicator generates signals that alert traders to potential reversal opportunities.



## Building the High/Low Tracking Framework


The foundation of the Supply Demand Edge indicator lies in its ability to accurately track daily highs and lows for both price and breadth measures. This tracking must account for regular trading session boundaries to ensure that pre-market and after-hours activity doesn't interfere with the analysis.


The indicator uses a regular session definition that spans from 9:30 AM to 4:00 PM EST, the standard NYSE trading hours. This boundary ensures that breadth calculations remain meaningful since NYSE TICK and Advance/Decline data are only available during regular market hours.



```
def regularSession = secondsFromTime(0930) > 0 && secondsTillTime(1600) > 0;
```


Within this session framework, the indicator maintains running calculations of daily highs and lows for both price and breadth measures. For price data, it tracks the highest high and lowest low of the current trading session. For breadth data, it separately tracks the highest and lowest readings for both TICK and Advance/Decline spread.


This multi-layered tracking system enables the indicator to make accurate comparisons between current readings and daily extremes, which forms the basis for divergence detection. The session-based approach ensures that each trading day starts with a clean slate, preventing previous day's data from influencing current day's analysis.



## Divergence Detection Logic and Signal Generation


The core functionality of the Supply Demand Edge indicator revolves around its divergence detection algorithms. These algorithms continuously compare current breadth readings to daily extremes whenever price reaches new highs or lows, identifying moments when market internals fail to confirm price action.


For bearish divergence detection (short signals), the indicator looks for situations where:




- Price reaches a new daily high (current high equals high of day)

- TICK or A/D spread fails to reach a new daily high (current reading < daily high)


This combination suggests that while price has moved to new highs, the underlying buying pressure or market participation has weakened compared to earlier in the session. Such divergences often precede short-term price reversals as the lack of breadth confirmation indicates that the advance lacks sustainability.


For bullish divergence detection (long signals), the logic reverses:




- Price reaches a new daily low (current low equals low of day)

- TICK or A/D spread shows improvement from daily lows (current reading > daily low)


This pattern indicates that while price has declined to new lows, the underlying selling pressure or market participation has diminished. The improvement in breadth readings despite new price lows often signals that the decline is losing momentum and a bounce may be imminent.


The indicator generates visual signals through arrow plots that appear directly on the price chart. Up arrows indicate bullish divergences (potential long opportunities), while down arrows mark bearish divergences (potential short opportunities). Different colors distinguish between TICK-based signals and A/D-based signals, allowing traders to understand the source of each divergence.



## Customization and Display Options


Professional trading requires flexibility in indicator presentation, and the Supply Demand Edge indicator provides several customization options to accommodate different trading styles and preferences. Two primary input parameters control signal display:


**showTicks Parameter:** This boolean input allows traders to enable or disable TICK-based divergence signals. Some traders prefer to focus exclusively on Advance/Decline divergences, particularly when trading stocks that may not correlate strongly with broad NYSE TICK movements.


**showAD Parameter:** This boolean input controls the display of Advance/Decline spread divergence signals. Traders focusing on short-term price movements might prefer TICK signals over A/D signals due to their more immediate nature.


The visual presentation uses distinct colors for each signal type:




- TICK signals appear in red (short) and light green (long) with heavier line weights

- A/D signals appear in white with lighter line weights


This color coding system allows traders to quickly identify the source of each signal while maintaining chart readability. The different line weights help prioritize signal importance based on the trader's preferred analysis methodology.



## Integration with Volatility and Overbought/Oversold Analysis


The Supply Demand Edge indicator works exceptionally well when combined with volatility-based tools and overbought/oversold indicators. This complementary approach helps traders identify not just when divergences occur, but also when market conditions are most favorable for divergence-based reversals.


Volatility expansion often accompanies significant supply/demand imbalances, making periods of high volatility particularly conducive to divergence-based trading. When the Supply Demand Edge indicator generates signals during volatility expansion phases, the probability of meaningful reversals typically increases significantly.


Overbought and oversold conditions provide additional context for interpreting divergence signals. Divergences that occur when prices are extended from key moving averages or when oscillators show extreme readings often produce more reliable reversal signals than those occurring in neutral market conditions.


It's important to note that the Supply Demand Edge indicator is completely separate from the Edge Signals indicator. While both tools can complement volatility analysis, the Edge Signals indicator serves as an advanced overbought/oversold confirmation tool (similar to RSI but more sophisticated) and is exclusively available to Volatility Box members. The Supply Demand Edge indicator, in contrast, focuses specifically on supply/demand imbalance detection and is available to all traders.



## Practical Trading Applications and Strategy Development


**Scalping and Day Trading:** The Supply Demand Edge indicator excels in short-term trading applications where quick identification of reversal points provides significant advantages. Day traders can use the signals to time entries at key support and resistance levels, particularly when divergences align with technical levels.


**Swing Trading Enhancement:** For swing traders, the indicator helps identify optimal entry points within larger trends. Bullish divergences during pullbacks in uptrends often mark excellent buying opportunities, while bearish divergences during rallies in downtrends signal potential shorting opportunities.


**Risk Management:** The indicator also serves as a risk management tool by alerting traders when their positions may be vulnerable to reversal. Traders holding long positions can watch for bearish divergences as potential exit signals, while those holding short positions can monitor bullish divergences.


**Multi-Timeframe Analysis:** Advanced traders can apply the indicator across multiple timeframes to build comprehensive market pictures. Divergences on longer timeframes (15-minute, 30-minute) often provide more significant reversal signals than those on shorter timeframes.



## Timeframe Optimization and Performance Considerations


The Supply Demand Edge indicator adapts well to different timeframes, but certain considerations optimize its performance. On very short timeframes (1-minute, 2-minute), the indicator may generate numerous signals, some of which represent normal market noise rather than meaningful divergences. Traders using these timeframes should consider combining signals with additional confirmation filters.


Medium timeframes (5-minute to 15-minute) often provide the best balance between signal frequency and reliability. These timeframes allow enough time for meaningful divergences to develop while maintaining sufficient signal frequency for active trading.


Longer timeframes (30-minute and above) typically generate fewer but higher-quality signals. These timeframes work well for swing trading applications where traders seek larger moves and can tolerate lower signal frequency in exchange for higher reliability.



## Market Condition Adaptability


Different market conditions require different approaches to divergence analysis. During trending markets, traders should focus primarily on divergences that align with counter-trend opportunities, as these often provide the highest-probability reversal setups. In trending markets, divergences against the primary trend typically produce short-term reversals rather than trend changes.


Range-bound markets often provide ideal conditions for divergence-based trading, as the lack of strong directional bias makes reversals more likely when divergences occur. In these conditions, both bullish and bearish divergences tend to produce meaningful moves as the market oscillates between support and resistance levels.


High-volatility periods, such as those following major news events or during earnings seasons, can produce more pronounced divergences but also carry higher risk. Traders should adjust position sizes and risk parameters during these periods while remaining alert to the increased profit potential that volatility expansion provides.



## Advanced Signal Interpretation Techniques


Experienced traders can enhance the indicator's effectiveness through advanced signal interpretation techniques. Multiple consecutive signals in the same direction often indicate strong underlying imbalances and may warrant larger position sizes or extended holding periods.


The strength of divergences varies based on the magnitude of the breadth reading differences. Large divergences (where current readings differ significantly from daily extremes) typically produce more reliable signals than marginal divergences where the differences are minimal.


Signal clustering around key technical levels (support, resistance, moving averages) often increases reliability significantly. When divergences align with established technical analysis principles, the probability of successful trades typically improves substantially.



## Risk Management and Position Sizing


Effective use of the Supply Demand Edge indicator requires proper risk management and position sizing protocols. While the indicator identifies high-probability setups, not every signal will produce profitable trades, making risk control essential for long-term success.


Position sizing should account for the indicator's historical performance characteristics and current market volatility. During periods of low volatility, smaller position sizes may be appropriate as potential moves may be limited. Conversely, during high-volatility periods, reduced position sizes help manage the increased risk while still capitalizing on the enhanced profit potential.


Stop-loss placement should consider both the technical setup and the typical performance characteristics of divergence signals. Since divergences often precede reversals rather than immediate moves, allowing adequate room for normal price fluctuation while maintaining acceptable risk levels requires careful balance.



## Conclusion: Leveraging Market Imbalances for Trading Success


The Supply Demand Edge indicator provides traders with a systematic approach to identifying market imbalances that often precede profitable reversal opportunities. By automating the detection of divergences between price action and underlying market breadth, the indicator helps traders spot opportunities that manual analysis might miss while reducing the time and effort required for market monitoring.


Success with the indicator requires understanding its strengths and limitations while integrating it effectively with broader trading strategies. When used in conjunction with volatility analysis, technical levels, and proper risk management, the Supply Demand Edge indicator can significantly enhance trading performance across various market conditions and timeframes.


Remember that this indicator serves a different purpose than the Edge Signals indicator available to Volatility Box members. While both tools can enhance trading performance, the Supply Demand Edge focuses specifically on supply/demand imbalance detection, making it an excellent complement to other technical analysis tools and trading systems.

## thinkScript code

```
#TOS Indicators
#Home of the Volatility Box
#More info regarding this indicator here: tosindicators.com/supply-demand-edge
#Code initially written in 2019 
#Full Youtube Tutorial here: https://youtu.be/RNtsjfHYWfs

declare upper;
declare hide_on_daily;

input showTicks = yes;
input showAD = yes;

def regularSession = secondsFromTime(0930) > 0 && secondsTillTime(1600) > 0;

def hod = if regularSession then if (high > hod[1]) then high else hod[1] else high;
def lod = if regularSession then if (low < lod[1]) then low else lod[1] else low;

def highAD = if regularSession then if (high(symbol="$ADSPD") > highAD[1]) then high(symbol="$ADSPD") else highAD[1] else high(symbol="$ADSPD");
def lowAD = if regularSession then if (low(symbol="$ADSPD") < lowAD[1]) then low(symbol="$ADSPD") else lowAD[1] else low(symbol="$ADSPD");

def highTick = if regularSession then if (high(symbol="$TICK") > highTick[1]) then high(symbol="$TICK") else highTick[1] else high(symbol="$TICK");
def lowTick = if regularSession then if (low(symbol="$TICK") < lowTick[1]) then low(symbol="$TICK") else lowTick[1] else low(symbol="$TICK");

def currentHighAD = high(symbol="$ADSPD");
def currentLowAD = low(symbol="$ADSPD");
def currentHighTick = high(symbol="$TICK");
def currentLowTick = low(symbol="$TICK");

plot ADShortSignal = showAD && high == hod && currentHighAD < highAD;
ADShortSignal.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_DOWN);
ADShortSignal.SetDefaultColor(Color.WHITE);
ADShortSignal.SetLineWeight(1);

plot ADLongSignal = showAD && low == lod && currentLowAD > LowAD;
ADLongSignal.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_UP);
ADLongSignal.SetDefaultColor(Color.WHITE);
ADLongSignal.SetLineWeight(1);

plot TickShortSignal = showTicks && high == hod && currentHighTick < highTick;
TickShortSignal.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_DOWN);
TickShortSignal.SetDefaultColor(Color.RED);
TickShortSignal.SetLineWeight(2);

plot TickLongSignal = showTicks && low == lod && currentLowTick > lowTick;
TickLongSignal.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_UP);
TickLongSignal.SetDefaultColor(Color.LIGHT_GREEN);
TickLongSignal.SetLineWeight(2);
```

## Questions

### How does the Supply Demand Edge indicator work?

The Supply Demand Edge indicator detects supply and demand imbalances by monitoring divergences between price action and market breadth data (NYSE TICK and Advance/Decline spread). When price reaches new daily highs but TICK or A/D data fails to confirm, it signals potential bearish divergence. When price makes new lows but breadth data improves, it signals potential bullish divergence.

### What's the difference between Supply Demand Edge and Edge Signals indicators?

The Supply Demand Edge indicator focuses on detecting supply/demand imbalances using NYSE TICK and Advance/Decline divergences. The Edge Signals indicator is a completely separate tool exclusively for Volatility Box members that serves as an advanced overbought/oversold confirmation system (like RSI on steroids). Both complement volatility analysis but serve different purposes.

### Why does the indicator use regular session hours and how does it handle extended hours?

The indicator uses regular session hours (9:30 AM - 4:00 PM EST) because NYSE TICK and Advance/Decline data are only available during regular market hours. The code includes extended hours compatibility, automatically handling the session boundaries to ensure accurate high/low tracking regardless of your chart's extended hours settings.

### What do the different colored arrows represent in the Supply Demand Edge indicator?

The indicator uses different colors to distinguish signal sources: TICK-based signals appear in red (bearish) and light green (bullish) with heavier line weights, while Advance/Decline signals appear in white with lighter line weights. This color coding helps traders quickly identify whether divergences are based on immediate buying/selling pressure (TICK) or broader market participation (A/D).

### Can I customize which signals the Supply Demand Edge indicator displays?

Yes, the indicator includes two input parameters: 'showTicks' and 'showAD' (both default to 'yes'). You can disable TICK signals by setting showTicks to 'no' or disable Advance/Decline signals by setting showAD to 'no'. This allows you to focus on your preferred divergence type based on your trading style and preferences.

### What timeframes work best with the Supply Demand Edge indicator?

Medium timeframes (5-15 minutes) often provide the best balance between signal frequency and reliability. Very short timeframes (1-2 minutes) may generate too much noise, while longer timeframes (30+ minutes) produce fewer but higher-quality signals. Choose based on your trading style: scalpers use shorter timeframes, swing traders prefer longer ones.

### How should I combine the Supply Demand Edge indicator with other analysis tools?

The indicator works excellently with volatility-based tools and overbought/oversold indicators. Use it to identify reversal opportunities in volatility expansion zones or when prices are extended from moving averages. Combine with support/resistance levels, and consider using alongside indicators like the Volatility Box models for comprehensive market timing.

### Do divergence signals from the Supply Demand Edge indicator always lead to reversals?

No, not all divergence signals lead to immediate or significant reversals. The indicator identifies high-probability opportunities, but success rates vary based on market conditions, signal strength, and confluence with other technical factors. Use proper risk management, position sizing, and combine with additional confirmation tools for best results.

## Related

- [2 Ways to Use NYSE $TICK to Spot Trend Days](https://tosindicators.com/research/nyse-tick-spot-trend-days-thinkorswim)
- [What Market Internals are Telling Us About Tomorrow](https://tosindicators.com/research/market-internals-telling-us-tomorrow-thinkorswim)
- [How to Build a Fair Value Gap Indicator in ThinkorSwim](https://tosindicators.com/indicators/fair-value-gap)
- [How to Build a Heiken Ashi Trend Dots Indicator in ThinkOrSwim](https://tosindicators.com/indicators/heiken-ashi)
- [Commodities Tracker](https://tosindicators.com/indicators/commodities-tracker)
- [Trend Squeeze](https://tosindicators.com/indicators/trend-squeeze)

