D04-F04-A02 / Complete engineering topic

Arms Index (TRIN)

A production-minded guide to Arms Index (TRIN).

D04 · MARKET BREADTH AND INTERNALS
D04-F04-A02Canonical / 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

Two sessions can have the same upside/downside volume ratio and still tell different pressure stories once issue participation is counted.

Arms Index (TRIN) answers one bounded question: is volume more concentrated in advancing or declining issues after controlling for their counts? 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

Build two ratios from the same universe: advancing issues per declining issue and advancing volume per declining-volume share. Divide the first by the second only when all four legs are positive.

Upside/Downside Volume Ratio owns only the volume denominator. TRIN adds an issue-count normalization, so identical volume ratios can produce different TRIN values.

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:

TRINt=(At/Dt)/(Vt+/Vt)TRIN_t = (A_t/D_t)/(V^+_t/V^-_t)

Publish only when all four count and volume legs are strictly positive. Publication invariant: Zero count or zero volume creates an incomplete denominator topology; the package never manufactures infinity or a neutral 1.

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.

Arms Index (TRIN) supports this bounded source role: trin divides the advancing/declining issue ratio by the advancing/declining volume ratio. 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:

ComponentArithmeticResult
Issue ratio600 / 4001.5000
Volume ratio120,000,000 / 60,000,0002.0000
TRIN1.5000 / 2.00000.7500

Both denominators and both numerators are positive. The output is therefore finite and resolved.

The expected output is:

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

Decompose TRIN before interpreting it.

The SVG is not a decorative output card. It isolates the algorithm's actual learning obstacle: one displayed number hides two different ratios and four denominator-sensitive legs. 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 four synchronized positive legs
issue_ratio = advances / declines
volume_ratio = advancing_volume / declining_volume
return issue_ratio / volume_ratio with both diagnostics

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 change issue participation separately from volume concentration and observe which ratio moves.

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

Use the decomposed issue and volume ratios to diagnose whether the headline TRIN value came from counts, volume concentration, or both.

Do not misuse it: Do not interpret a zero leg as neutral, infinity, or 1.0, and do not mix count and volume legs from different exchanges or cutoffs.

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

  • Any zero leg makes the two-ratio topology incomplete in this package.
  • TRIN equals 1 only when the issue ratio equals the volume ratio; it is not a default.
  • Multiplying both volume legs by the same scale leaves TRIN unchanged.
  • Smoothing TRIN is a separate derived series with its own warm-up and identity.

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 TRIN_t = (A_t/D_t)/(V^+_t/V^-_t), interpret dimensionless ratio, audit the method-specific boundary, and reproduce matching Python and TypeScript behavior. Review Upside/Downside Volume Ratio and Advance/Decline Ratio for the immediate input concept. Continue with Zweig Breadth Thrust in the dependency path.

Calculation Flow — Arms Index (TRIN)

Purpose: One displayed number hides two different ratios and four denominator-sensitive legs.

Rendering system map…

Takeaway: Decompose TRIN before interpreting it.

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
FIDELITY-TRINTRIN divides the advancing/declining issue ratio by the advancing/declining volume ratio.Interpretive labels do not define this package's zero policy or prove a trading outcome.
STOCKCHARTS-TRINThe standard formula and the importance of pairing count and volume ratios from one declared universe.Threshold interpretations and smoothing choices are not universal mathematics.
TRADESTATION-TRINA maintained implementation accepts advancing issues, advancing volume, declining issues, and declining volume as separate inputs.Platform symbols and smoothing examples are not part of this package's canonical output.

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.

FIDELITY-TRIN — Arms Index (TRIN)

  • Organization or authors: Fidelity
  • Source type: Maintained broker technical-indicator guide
  • Publication or effective date: Current documentation
  • Version or retrieval state: Exact page or PDF retrieved 2026-07-26
  • URL: https://www.fidelity.com/learning-center/trading-investing/technical-analysis/technical-indicator-guide/trin
  • Accessed: 2026-07-26
  • Jurisdiction or applicability: Technical-analysis convention
  • Evidence role: sourced/provider convention
  • Supports: TRIN divides the advancing/declining issue ratio by the advancing/declining volume ratio.
  • Limitations: Interpretive labels do not define this package's zero policy or prove a trading outcome.

STOCKCHARTS-TRIN — Arms Index (TRIN)

  • 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/arms-index-trin
  • Accessed: 2026-07-26
  • Jurisdiction or applicability: Provider implementation using exchange breadth
  • Evidence role: sourced/provider convention
  • Supports: The standard formula and the importance of pairing count and volume ratios from one declared universe.
  • Limitations: Threshold interpretations and smoothing choices are not universal mathematics.

TRADESTATION-TRIN — ArmsIndex Function

  • Organization or authors: TradeStation
  • Source type: Official software reference
  • Publication or effective date: Current version 10 documentation
  • Version or retrieval state: Exact page or PDF retrieved 2026-07-26
  • URL: https://help.tradestation.com/10_00/eng/tsdevhelp/elword/function/armsindex_function_.htm
  • Accessed: 2026-07-26
  • Jurisdiction or applicability: TradeStation EasyLanguage
  • Evidence role: sourced/provider convention
  • Supports: A maintained implementation accepts advancing issues, advancing volume, declining issues, and declining volume as separate inputs.
  • Limitations: Platform symbols and smoothing examples are not part of this package's canonical output.

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.

arms_index_trin.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(row:any):Result {
  const names=["advances","declines","advancing_volume","declining_volume"]; const values:any={};
  for (const name of names) values[name]=numberValue(row[name],name);
  if (row.ready===false) return {status:"incomplete",reason:"unready observation",value:null};
  if (names.some(name=>values[name]<=0)) return {status:"incomplete",reason:"all four legs must be positive",value:null};
  const issue_ratio=values.advances/values.declines, volume_ratio=values.advancing_volume/values.declining_volume;
  return {status:"resolved",value:issue_ratio/volume_ratio,issue_ratio,volume_ratio};
}
Full-height labplaygroundOpen full screen