Zweig Breadth Thrust
Install and import
npm install fintech-algorithmsimport { calculate } from "fintech-algorithms/market-breadth-and-internals/thrust-and-pressure/zweig-breadth-thrust";Signature
calculate(rows, emaLength, lowThreshold, highThreshold, maxSessions)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",
"advances": 520,
"declines": 480,
"ready": true
},
{
"session_date": "2026-01-06",
"advances": 500,
"declines": 500,
"ready": true
},
{
"session_date": "2026-01-07",
"advances": 480,
"declines": 520,
"ready": true
}
]Showing 3 of 24 elements.
100.40.61510Call
calculate(rows, emaLength, lowThreshold, highThreshold, maxSessions)Returns
object with 5 fields: status, trigger_date, ema, sessions, series
{
"status": "thrust",
"trigger_date": "2026-01-28",
"ema": 0.6648021169863199,
"sessions": 6,
"series": [
{
"date": "2026-01-05",
"ratio": 0.52,
"ema": 0.52,
"state": "idle"
},
{
"date": "2026-01-06",
"ratio": 0.5,
"ema": 0.5163636363636364,
"state": "idle"
},
{
"date": "2026-01-07",
"ratio": 0.48,
"ema": 0.5097520661157025,
"state": "idle"
}
]
}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 Indicators — StockCharts ChartSchool
- Advance Decline Ratio Indicators, Chapter 5 — Greg Morris, StockCharts
- Historical-example decision