fintech-algorithms

Zweig Breadth Thrust

Install and import

bash
npm install fintech-algorithms
ts
import { 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

rows
[
  {
    "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.

emaLength
10
lowThreshold
0.4
highThreshold
0.615
maxSessions
10

Call

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

Zweig Breadth Thrust — decision boundary
Zweig Breadth Thrust — family map

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.

Read the article →

References

  • Claim-to-source map
  • Advance-Decline Indicators — StockCharts ChartSchool
  • Advance Decline Ratio Indicators, Chapter 5 — Greg Morris, StockCharts
  • Historical-example decision