D04-F04-A03 / Complete engineering topic

Advance/Decline Volume Line

A production-minded guide to Advance/Decline Volume Line.

D04 · MARKET BREADTH AND INTERNALS
D04-F04-A03Canonical / Tested / Open
D04 / D04-F04
Key concepts

The governed definitions this build depends on. Read them first if a term is unfamiliar.

The hidden decision

A cumulative breadth line can rise for several different reasons; the audit trail must show exactly which daily volume increments built it.

Advance/Decline Volume Line answers one bounded question: how has the running balance of volume in advancing versus declining issues evolved from a declared seed? Its value is not a prediction. Its value is an auditable state whose inputs, time, units, and failure conditions are visible.

By the end, you will be able to calculate the method, reproduce its synthetic case, inspect its implementation trace, and decide when the output must be withheld.

Build the mental model

Subtract declining from advancing volume each session, then add that signed increment to an explicitly named seed in chronological order.

The volume line preserves share scale and path memory. Upside/Downside Volume Ratio discards both by normalizing one session's two volume legs.

Where the method sits in Thrust and Pressure

The highlighted family card is a scope boundary. Count breadth, volume composition, recursive pressure, intraday sampling, and causal divergence can all produce lines, but their units and state memories are not interchangeable.

Freeze the contract before calculating

The selected formulation is:

ADVLt=ADVLt1+(Vt+Vt)ADVL_t = ADVL_{t-1} + (V^+_t - V^-_t)

Accumulate net advancing share volume from an explicit zero seed and retain the series identity. Publication invariant: A different start date changes the level but not the increments; missing or negative volume withholds the recursive tail.

The input table in the canonical README defines row fields and units. The parameter table distinguishes a sourced method from package choices such as equality behavior, seed, zero policy, sampling grid, normalized breadth scale, and event timestamp.

Advance-Decline Volume Line supports this bounded source role: net advancing volume is advancing minus declining volume, and the line recursively adds it to the previous value. It does not override the limitations recorded in REFERENCES.md, and it does not establish historical performance.

Reproduce the synthetic result

Every observation below is synthetic. The arithmetic is author-derived:

SessionsNet-volume subtotalRunning level
1–610,000,000 shares10,000,000 shares
7–120 shares10,000,000 shares
13–182,000,000 shares12,000,000 shares
19–2484,000,000 shares96,000,000 shares

The four subtotals bridge the declared zero seed to 96,000,000 shares. Replacing the seed with 10,000,000 would shift every running level by 10,000,000 without changing any subtotal.

The expected output is:

JSON
{
  "status": "resolved",
  "value": 96000000
}

Interpret increments across seeds; interpret levels only within one series identity.

The SVG is not a decorative output card. It isolates the algorithm's actual learning obstacle: the final level hides the signed daily increments and the seed-dependent path. Notice the labels and dashed or branched boundaries; color is supplementary.

Calculation flow

The Mermaid diagram renders from visuals/mermaid/calculation-flow.md and follows this pseudocode:

Plain text
validate a nonempty ordered volume-breadth tail
level = declared seed
for each session:
    net = advancing_volume - declining_volume
    level = level + net
    append net and level to trace
return final level and full trace

Validation comes first so bad evidence cannot mutate later state. That rule is especially important for recursive lines, timestamp grids, arming clocks, and right-side pivot confirmation.

Read the implementation

Python and TypeScript both:

  1. validate finite inputs and the topic's identity/clock rules;
  2. compute the named intermediate values;
  3. preserve the trace needed to audit the result; and
  4. return a numeric value or typed event only when the publication boundary passes.

They share datasets/canonical-fixture.json, including expected output and parameters. The code avoids provider SDKs and hidden network calls so the teaching arithmetic is fully inspectable.

Use the guided lab

Open visuals/animated/playground.html. Its objective is to step through positive and negative net volume, then change seed and missing-tail scenarios.

The initial screen is the completed canonical state. Back and Step reveal one observation at a time; Play uses the same transition function; Pause stops it; Reset restores the scenario and parameter. Comparison isolates a nearby outcome, while Failure / boundary demonstrates a reason code rather than a persuasive fake value. Reduced-motion Play advances one deterministic step without starting a timer.

The diagnostic panel and audit table should be read together. A smooth chart alone cannot prove denominator topology, chronological completeness, sampling continuity, or causal confirmation.

Operational interpretation

Audit the increment separately from the cumulative level so corrections and seed changes can be traced to the exact affected tail.

Do not misuse it: Do not compare absolute levels from different seed dates as though they shared one origin, and never skip a missing recursive member.

Passing the implementation checks proves definition fidelity. It does not prove reversal prediction, causal market explanation, trading profitability, transferability to another universe, or performance after costs.

Edge cases worth testing

  • A different seed shifts every level by a constant but leaves each net-volume increment unchanged.
  • A missing or unready session invalidates that point and the later recursive tail.
  • Duplicate or decreasing session dates are invalid even if the arithmetic sum is unchanged.
  • A provider correction requires replay from the corrected session, not a one-point patch.

Provider corrections require recomputing the affected tail or event set. A corrected observation that becomes available later must not leak into an earlier point-in-time result.

Evidence and historical boundary

A named historical reconstruction remains deferred. Publication would require a licensed point-in-time universe, exact classification rules, synchronized observations, session and sampling policy, correction lineage, the selected calculation convention, a knowledge cutoff, and redistribution rights.

Using a famous chart without that bundle would make the story stronger and the evidence weaker. The labelled synthetic fixture is therefore the responsible public example.

Summary and handoff

You can now calculate ADVL_t = ADVL_{t-1} + (V^+_t - V^-_t), interpret shares, audit the method-specific boundary, and reproduce matching Python and TypeScript behavior. Review Net Advances for the immediate input concept. Continue with Upside/Downside Volume Ratio in the dependency path.

Calculation Flow — Advance/Decline Volume Line

Purpose: The final level hides the signed daily increments and the seed-dependent path.

Rendering system map…

Takeaway: Interpret increments across seeds; interpret levels only within one series identity.

ReferencesPrimary sources and evidence notes

Expand the source trail, evidence role, and limitations behind the engineering choices.

Claim-to-source map

Source IDWhat it supportsBoundary
STOCKCHARTS-ADVLNet advancing volume is advancing minus declining volume, and the line recursively adds it to the previous value.The absolute level depends on the seed date; divergence commentary is not a performance guarantee.
STOCKCHARTS-BREADTHExchange breadth series have explicit universe, update-frequency, and provider lineage; issue and volume breadth must retain series identity.Provider symbols and data feeds do not make one universe or classification rule universal.
NYSE-VOLUMEThe versioned official volume product identifies venue/listing coverage and fields, so volume provenance and product version must be retained.The specification does not publish a free advancing/declining classification series or grant redistribution rights.

The formula/concept source and the data-provenance source do different jobs. Exchange product documentation establishes venue fields, versioned feeds, and licensing boundaries; it does not silently define every derived indicator. Package-selected zero, seed, refresh, sampling, scale, and confirmation rules remain implementation choices.

STOCKCHARTS-ADVL — Advance-Decline Volume Line

  • Organization or authors: StockCharts ChartSchool
  • Source type: Maintained provider-method documentation
  • Publication or effective date: Current documentation
  • Version or retrieval state: Exact page or PDF retrieved 2026-07-26
  • URL: https://chartschool.stockcharts.com/table-of-contents/market-indicators/advance-decline-volume-line
  • Accessed: 2026-07-26
  • Jurisdiction or applicability: Exchange-specific breadth series
  • Evidence role: sourced/provider convention
  • Supports: Net advancing volume is advancing minus declining volume, and the line recursively adds it to the previous value.
  • Limitations: The absolute level depends on the seed date; divergence commentary is not a performance guarantee.

STOCKCHARTS-BREADTH — Advance-Decline Indicators

  • Organization or authors: StockCharts ChartSchool
  • Source type: Maintained provider-method documentation
  • Publication or effective date: Current documentation
  • Version or retrieval state: Exact page or PDF retrieved 2026-07-26
  • URL: https://chartschool.stockcharts.com/table-of-contents/index-and-market-indicator-catalog/advance-decline-indicators
  • Accessed: 2026-07-26
  • Jurisdiction or applicability: Provider series for major U.S. and Canadian exchanges
  • Evidence role: sourced/provider convention
  • Supports: Exchange breadth series have explicit universe, update-frequency, and provider lineage; issue and volume breadth must retain series identity.
  • Limitations: Provider symbols and data feeds do not make one universe or classification rule universal.

NYSE-VOLUME — Volume Summary Client Specification v1.1d

  • Organization or authors: New York Stock Exchange
  • Source type: Official market-data technical specification
  • Publication or effective date: 2026-04-20, version 1.1d
  • Version or retrieval state: Exact page or PDF retrieved 2026-07-26
  • URL: https://www.nyse.com/publicdocs/nyse/data/Volume_Summary_Client_Spec_v1.1d.pdf
  • Accessed: 2026-07-26
  • Jurisdiction or applicability: NYSE Group equities
  • Evidence role: sourced/provider convention
  • Supports: The versioned official volume product identifies venue/listing coverage and fields, so volume provenance and product version must be retained.
  • Limitations: The specification does not publish a free advancing/declining classification series or grant redistribution rights.

Historical-example decision

Deferred. A named reconstruction requires the exact point-in-time universe, classification method, timestamps, correction lineage, session rules, calculation convention, and redistribution rights. This public package publishes labelled synthetic inputs and author-derived arithmetic instead. It makes no historical-association, prediction, causation, or profitability claim.

advance_decline_volume_line.ts
export type Result = Record<string, any>;
const numberValue = (value: unknown, name: string): number => {
  if (typeof value !== "number" || !Number.isFinite(value)) throw new Error(`${name} must be a finite number`);
  return value;
};

export function calculate(rows:any[],seed=0):Result {
  if(!rows.length)return{status:"incomplete",reason:"no observations",value:null,series:[]};
  let level=numberValue(seed,"seed"),previousDate:string|null=null; const series:any[]=[];
  for (const row of rows) {if(row.ready===false)return{status:"incomplete",reason:"unready observation",value:null,series};
    if(typeof row.session_date!=="string"||!/^\d{4}-\d{2}-\d{2}$/.test(row.session_date)||Number.isNaN(Date.parse(row.session_date)))return{status:"incomplete",reason:"invalid_session_date",value:null,series};
    if(previousDate!==null&&row.session_date<=previousDate)return{status:"incomplete",reason:"session_dates_must_increase",value:null,series};
    const up=numberValue(row.advancing_volume,"advancing_volume"),down=numberValue(row.declining_volume,"declining_volume");
    if(up<0||down<0)return{status:"incomplete",reason:"negative volume",value:null,series};
    const net=up-down;level+=net;series.push({date:row.session_date,net,value:level});previousDate=row.session_date;}
  return{status:"resolved",value:level,series};
}
Full-height labplaygroundOpen full screen