fintech-algorithms
Using a coding agent? Give it the skill: npx skills add IslamBaraka90/Fintech-Algorithms-Library What it does →

New Highs–New Lows

Install and import#

bash
npm install fintech-algorithms
ts
import { calculate } from "fintech-algorithms/market-breadth-and-internals/high-low-and-trend-breadth/new-highs-new-lows";

Signature#

calculate(records, decisionTime)

Counts issues making new 52-week highs and lows. Unlike advance/decline it measures position against a long lookback rather than one session, so it detects a rally where fewer and fewer names reach new ground.

Parameters#

NameTypeNotes
recordsRecord[]Session records with evidence state and universe identity.
decisionTimestringPoint-in-time bound on which revisions may be used.

Returns#

Row[] · length same-as-input

Per-session highs and lows with the eligible count — the denominator matters, because a count of 30 new highs means different things in a universe of 500 and one of 3,000.

Errors#

  • When a record lacks the lookback history the count requires — excluded and reported rather than thrown

Complexity: time O(records), space O(sessions).

Worked example#

verified This is the worked example published in the article, replayed by the test suite on every run. The output cannot drift.

Input#

records
[
  {
    "session_date": "2026-01-15",
    "available_at": "2026-01-15T21:30:00Z",
    "source_evidence_state": "ready",
    "venue_id": "SYNTH-X",
    "universe_id": "SYNTH-HIGH-LOW-12",
    "methodology_id": "synthetic-high-low-v1",
    "lookback_sessions": 252,
    "new_highs": 2,
    "new_lows": 10,
    "eligible_issues": 12,
    "overlap_issues": 0
  }
]
decisionTime
"2026-03-01T00:00:00Z"

Call#

calculate(records, decisionTime)

Returns#

object with 1 field: 0

{
  "0": {
    "session_date": "2026-01-15",
    "new_highs": 2,
    "new_lows": 10,
    "value": -8,
    "status": "resolved",
    "reason": null
  }
}

Diagrams#

New Highs–New Lows — decision boundary
New Highs–New Lows — family map
New Highs–New Lows — worked state

Calculation flow#

Topic decision flow — New Highs–New Lows
flowchart LR
    A["Ready NH and NL counts"] --> B["Subtract NL from NH"]
    B --> C{"Sign"}
    C -->|"positive"| D["More new highs"]
    C -->|"zero"| E["Balanced or genuine no-extremes"]
    C -->|"negative"| F["More new lows"]
    D --> G["Publish issues + universe size"]
    E --> G
    F --> G

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#

  • Nasdaq Fundamental Data
  • How High/Low and New High/New Low Are Calculated
  • New 52-Week Highs and Lows for Exchanges
  • Evidence decision

The rest of the High/Low and Trend Breadth family#