Upside/Downside Volume Ratio
Install and import#
npm install fintech-algorithmsimport { calculate } from "fintech-algorithms/market-breadth-and-internals/thrust-and-pressure/upside-downside-volume-ratio";Signature#
calculate(row)Advancing volume over declining volume for one session. Extreme readings mark the days that matter — a 9-to-1 up day is a recognised initiation signal precisely because it is rare.
Parameters#
| Name | Type | Notes |
|---|---|---|
row | Row | One session's directional volume. Rows carry a ready flag; a row that is not ready is excluded rather than treated as zero, because a missing count and a count of zero mean opposite things about market breadth. |
Returns#
{ status, value }
The ratio, or a status explaining why it could not be formed.
Errors#
- When declining volume is zero — reported as a status rather than thrown
Complexity: time O(1),
space O(1).
Worked example#
executed Captured by running this function on the input its own test provides. Real output of real code — but not asserted against a published figure.
Input#
{
"session_date": "2026-02-05",
"advances": 600,
"declines": 400,
"unchanged": 20,
"advancing_volume": 120000000,
"declining_volume": 60000000,
"ready": true
}Call#
calculate(row)Returns#
object with 2 fields: status, value
{
"status": "resolved",
"value": 2
}Diagrams#
Calculation flow#
Calculation Flow — Upside/Downside Volume Ratio
flowchart LR
A["Nonnegative V+ and V−"] --> B{"V− > 0?"}
B -->|"Yes"| C["Publish V+/V−"]
B -->|"No"| D{"V+ > 0?"}
D -->|"Yes"| E["Unbounded; withhold value"]
D -->|"No"| F["Incomplete 0/0"]
How it works#
This page states the contract — how to call it correctly. The article explains the concept: why it works, and where it breaks.
References#
- Claim-to-source map
- Up Volume Down Volume Indicators, Chapter 8 — Greg Morris, StockCharts
- NYSE Breadth Symbol Catalog — StockCharts
- Volume Summary Client Specification v1.1d — New York Stock Exchange
- Historical-example decision