High-Low Index
Install and import#
npm install fintech-algorithmsimport { calculate } from "fintech-algorithms/market-breadth-and-internals/high-low-and-trend-breadth/high-low-index";Signature#
calculate(records, decisionTime)A moving average of the high–low ratio, which turns a noisy daily reading into something with a usable trend.
Parameters#
| Name | Type | Notes |
|---|---|---|
records | Record[] | Session records with evidence state. |
decisionTime | string | Point-in-time bound. |
Returns#
Row[] · length same-as-input
The smoothed index per session.
Errors#
- When insufficient history for the smoothing window — reported per row 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#
[
{
"session_date": "2026-01-06",
"available_at": "2026-01-06T21: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": 7,
"new_lows": 5,
"eligible_issues": 12,
"overlap_issues": 0
},
{
"session_date": "2026-01-07",
"available_at": "2026-01-07T21: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": 7,
"new_lows": 5,
"eligible_issues": 12,
"overlap_issues": 0
},
{
"session_date": "2026-01-08",
"available_at": "2026-01-08T21: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": 7,
"new_lows": 5,
"eligible_issues": 12,
"overlap_issues": 0
}
]Showing 3 of 10 elements.
"2026-03-01T00:00:00Z"Call#
calculate(records, decisionTime)Returns#
object with 1 field: 9
{
"9": {
"session_date": "2026-01-15",
"new_highs": 2,
"new_lows": 10,
"value": 54.166666666666664,
"status": "resolved",
"reason": null
}
}Diagrams#
Calculation flow#
Topic decision flow — High-Low Index
flowchart LR
A["Daily NH and NL"] --> B{"NH + NL > 0?"}
B -->|"No"| I["Undefined RHP; contaminate active window"]
B -->|"Yes"| C["RHP = 100 × NH / (NH + NL)"]
C --> D["Append to rolling tray"]
D --> E{"Ten defined values?"}
E -->|"No"| W["Warming"]
E -->|"Yes"| F["Mean of ten RHP values"]
F --> G["Publish percentage points"]
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#
- Nasdaq Fundamental Data
- How High/Low and New High/New Low Are Calculated
- High-Low Index
- Rolling Mean Documentation
- Evidence decision