TradingView market breadth workflow

Advance-decline ratio on TradingView: universe and zero counts

The advance-decline ratio divides advancing issues by declining issues for one observation of a defined market. With 60 advances and 30 declines, the ratio is 2:1. It measures participation, not the size of price moves. Check the treatment of unchanged issues: TradingView's index and country breadth metrics include them in the declining group, while a three-category count keeps them separate. The ratio is not the cumulative Advance/Decline Line.

See the decision guide

Define advances, declines and unchanged issues

For a daily three-category calculation, compare each eligible issue's accepted closing price with its previous session close. A is the number with a positive change, D the number with a negative change, and U the number with exactly zero change. With complete observations, A + D + U equals the eligible universe. ADR = A / D when D > 0. Each issue gets one vote, regardless of its market value or percentage return.

  • ADR > 1 means advances outnumber declines under the chosen convention. ADR = 1 means equal counts, and a value between 0 and 1 means fewer advances than declines.
  • A ratio of 2 means two advances per decline, not a 2% market return. In the absence of unchanged or missing issues, it corresponds to 2 / (2 + 1) = 66.67% advancing.
  • Specify whether the population is an exchange, index constituents or a maintained basket. StockCharts documents that exchange issue data can include closed-end funds, preferred stocks and ADRs alongside common stocks.

TradingView has more than one counting convention

TradingView's general Advance/Decline Ratio article describes advancing stocks divided by declining stocks. Its separate index/country market-breadth documentation explicitly places zero price changes in the declining group and compares the current bar close with the preceding bar close. Under that convention, the denominator equals D + U when expressed using the three-category notation above. Confirm which dataset your chart or table uses.

  • These readings can describe exactly the same prices. A discrepancy is not automatically a feed error; first reconcile the flat-stock policy and reference period.
  • TradingView also documents Advance/Decline Ratio (Bars), which counts up and down bars of the current symbol over a lookback. It is not a count of stocks across a market.
  • The acronym ADR also appears in Average Daily Range. Check the full indicator name and its inputs before using a saved layout or alert threshold.
Hypothetical 100-issue observationCalculationResult
Three categories: A = 60, D = 30, U = 1060 / 302.00
TradingView index/country convention: 60 advancing, 40 non-advancing60 / (30 + 10)1.50
Advancing share of all 100 issues60 / 100 × 10060%

Separate the single-period ratio from the AD Line

Using the three-category convention and a constant 100-issue universe, net advances equal A - D. The AD Line adds each period's net advances to the prior line value. The example starts the line at zero; that starting level is a display choice. The ratio uses only the counts for the current observation.

  • Session 3 has balanced advances and declines, so ADR is 1.00 while the cumulative line remains -20. Those numbers answer different questions.
  • Do not add daily ratios to produce an AD Line. Do not assume averaging daily ratios gives a weekly ratio either: a weekly observation requires its own price-reference and counting rule.
  • An index can rise while ADR is below 1 because a few large constituents can dominate its return. That disagreement alone does not specify an entry, exit or reversal time.
SessionA / D / UADRNet advancesAD Line
160 / 30 / 1060 / 30 = 2.00+300 + 30 = 30
220 / 70 / 1020 / 70 = 0.2857-5030 - 50 = -20
345 / 45 / 1045 / 45 = 1.000-20 + 0 = -20

Handle zero declines without inventing a denominator

The following cases use valid counts from a hypothetical 100-issue universe. Treat the denominator-zero condition explicitly before testing a threshold. This guide recommends showing an unavailable numeric ratio with a separate explanation of the counts; it does not claim that every TradingView indicator renders the condition the same way.

  • A positive count divided by zero has no finite value; 0 / 0 is indeterminate. Neither case means a neutral ratio of 1.
  • Replacing D with 1 or a tiny positive constant changes the statistic. If a chart caps extreme values for display, preserve the actual counts and mark the cap.
  • An all-unchanged observation can produce zero under the non-advancing convention. That is not evidence that 100 prices fell. Labels must retain the counting rule.
A / D / UThree-category A / DA / (D + U)Meaning
90 / 0 / 10No finite ratio9.00No declining issues; 10 unchanged
0 / 90 / 100.000.00No advancing issues
0 / 0 / 100Undefined: 0 / 00.00Every observed issue is unchanged
100 / 0 / 0No finite ratioNo finite ratioAll observed issues advance

Keep suspended and missing issues visible

For a custom calculation, require valid prices for both comparison points. A suspended issue may have a carried-forward price, an official unchanged close or no usable observation, depending on the provider. A stale last trade does not by itself establish a fresh unchanged close. Document the source policy and keep unresolved observations in a missing group M rather than guessing their direction.

  • Suppose an intended 100-issue basket has A = 60, D = 30, U = 5 and M = 5. The observed three-category ratio is 2.00, but coverage is only 95 / 100 = 95%. It is not a complete-market reading.
  • If the five missing issues could each be up, down or unchanged, the full-basket ratio can range from 60 / 35 = 1.7143 to 65 / 30 = 2.1667. A rule requiring ADR > 2 cannot be resolved from this partial observation.
  • If all prices are missing from a known nonempty universe, show 0% coverage and an unavailable ratio. Do not turn absent inputs into A = 0 and D = 0 or carry the previous signal into a new session.
  • For a published aggregate, you may not have enough constituent data to reconstruct these categories. Keep that limitation in the review; do not claim a coverage audit that the feed cannot support.

Check membership changes and the observation time

A ratio removes the scale of the counts, but it does not remove changes in the sample. Imagine the original 100 issues still show 60 advances, 30 declines and 10 unchanged. Adding 50 issues, of which 40 decline and 10 are unchanged, changes the three-category ratio from 2.00 to 60 / 70 = 0.8571 without changing any original member's classification.

  • Retain the effective membership date and eligible security types. An expanding exchange series is a valid changing-universe measure; label it accordingly when comparing periods.
  • A fixed basket makes membership comparisons simpler but may omit later listings. A historical index study needs the constituents eligible at each date; using only today's survivors changes the sample.
  • Match the interval, session, timezone and timestamp of both counts. A daily ratio based on previous session closes is not interchangeable with changes since the prior five-minute bar.
  • Record when the final count became available. A corrected end-of-day figure cannot be treated as information known earlier that afternoon.

Turn a verified observation into a reviewable workflow

In TradingView, open the intended breadth series or index/country breadth view and record its full name, universe, reference period and latest timestamp. Recalculate one observation from the component counts before setting an alert. A table on a website does not establish that its data is available as a Pine-accessible chart symbol.

  • An example research condition is a completed-session three-category ADR above 2, with D > 0 and complete valid coverage. The 60 / 30 example equals 2, so it does not satisfy a strict above-2 condition. A zero denominator or missing member makes this particular rule unavailable.
  • Give Pineify's Pine Script AI Coding Agent the verified input symbols or basket, counting convention, availability time and missing-data policy to draft a chart aid or alert. Compare its output with the source counts. Code generation cannot recover absent breadth history.
  • Save the hypothesis, A/D/U counts, missing count, universe version, source timestamp and a screenshot URL in Trading Journal notes. Add the later review separately so the original observation remains distinguishable from its outcome.
  • The threshold is an illustrative rule to test, not a trade recommendation. Keep trade selection, risk limits and execution assumptions separate from the breadth observation.
Where Pineify fits

Pine Script AI Coding Agent

Draft a chart aid or alert from a documented breadth rule and available inputs. Specify the denominator and unavailable states, then review the generated code against the original counts.

Also useful: Trading Journal. Keep the original hypothesis, counts, timestamps and screenshot links in notes, then record the later review without confusing it with the initial signal.

Draft a breadth rule

Frequently asked questions

Educational information, not investment advice. All numerical examples are hypothetical. Breadth describes a specified sample and does not guarantee market direction, a reversal or profitable trading.

Sources and verification

Published by Pineify. Pineify is an independent product and is not affiliated with TradingView. Sources support the technical explanations; examples do not establish trading performance.