Breadth-Divergence Detector
Install and import
npm install fintech-algorithmsimport { calculate } from "fintech-algorithms/market-breadth-and-internals/thrust-and-pressure/breadth-divergence-detector";Signature
calculate(rows, left, right, minPriceChange, minBreadthSeparation, breadthScale)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-01-05",
"index_level": 100,
"breadth_value": 500,
"ready": true
},
{
"session_date": "2026-01-06",
"index_level": 101,
"breadth_value": 520,
"ready": true
},
{
"session_date": "2026-01-07",
"index_level": 102,
"breadth_value": 540,
"ready": true
}
]Showing 3 of 36 elements.
220.010.051000Call
calculate(rows, left, right, minPriceChange, minBreadthSeparation, breadthScale)Returns
object with 2 fields: status, events
{
"status": "bearish",
"events": [
{
"status": "bearish",
"first_pivot_date": "2026-01-19",
"second_pivot_date": "2026-02-05",
"confirmation_date": "2026-02-09",
"price_change": 0.05454545454545454,
"breadth_separation": -0.13,
"breadth_scale": 1000
}
]
}Diagrams
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
- Advance/Decline Indicator — Fidelity
- Advance-Decline Volume Line — StockCharts ChartSchool
- Advance-Decline Indicators — StockCharts ChartSchool
- Historical-example decision