fintech-algorithms

High-Low Ratio

Install and import

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

Signature

calculate(records, decisionTime)

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

records
[
  {
    "session_date": "2026-01-02",
    "effective_at": "2026-01-02T21:00:00Z",
    "available_at": "2026-01-02T21:25:00Z",
    "source_evidence_state": "ready",
    "venue_id": "SYNTH-X",
    "universe_id": "SYNTH-HL-120",
    "methodology_id": "session-high-low-vs-prior-252-sessions-v1",
    "lookback_sessions": 252,
    "new_highs": 9,
    "new_lows": 3,
    "eligible_issues": 120,
    "excluded_issues": 4,
    "overlap_issues": 0
  },
  {
    "session_date": "2026-01-05",
    "effective_at": "2026-01-05T21:00:00Z",
    "available_at": "2026-01-05T21:25:00Z",
    "source_evidence_state": "ready",
    "venue_id": "SYNTH-X",
    "universe_id": "SYNTH-HL-120",
    "methodology_id": "session-high-low-vs-prior-252-sessions-v1",
    "lookback_sessions": 252,
    "new_highs": 7,
    "new_lows": 5,
    "eligible_issues": 120,
    "excluded_issues": 4,
    "overlap_issues": 0
  },
  {
    "session_date": "2026-01-06",
    "effective_at": "2026-01-06T21:00:00Z",
    "available_at": "2026-01-06T21:25:00Z",
    "source_evidence_state": "ready",
    "venue_id": "SYNTH-X",
    "universe_id": "SYNTH-HL-120",
    "methodology_id": "session-high-low-vs-prior-252-sessions-v1",
    "lookback_sessions": 252,
    "new_highs": 4,
    "new_lows": 8,
    "eligible_issues": 120,
    "excluded_issues": 4,
    "overlap_issues": 0
  }
]

Showing 3 of 30 elements.

decisionTime
"2026-03-01T00:00:00Z"

Call

calculate(records, decisionTime)

Returns

array of 30 objects

[
  {
    "session_date": "2026-01-02",
    "new_highs": 9,
    "new_lows": 3,
    "value": 3,
    "status": "resolved",
    "reason": null
  },
  {
    "session_date": "2026-01-05",
    "new_highs": 7,
    "new_lows": 5,
    "value": 1.4,
    "status": "resolved",
    "reason": null
  },
  {
    "session_date": "2026-01-06",
    "new_highs": 4,
    "new_lows": 8,
    "value": 0.5,
    "status": "resolved",
    "reason": null
  }
]

Showing 3 of 30 elements.

Diagrams

High-Low Ratio — decision boundary
High-Low Ratio — family map
High-Low Ratio — worked state

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