# High-Low Index

`D04-F03-A03` · Market Breadth and Internals → High/Low and Trend Breadth · archetype `record-transform` · difficulty 3/5 · verification **verified**

Full page: https://docs.thefintechbuilder.com/market-breadth-and-internals/high-low-and-trend-breadth/high-low-index/
Agent skill: `npx skills add IslamBaraka90/Fintech-Algorithms-Library` — https://docs.thefintechbuilder.com/guides/agent-skill/

## 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-index";
```

## Signature

```ts
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 | Required | Notes |
| --- | --- | --- | --- |
| `records` | `Record[]` | yes | Session records with evidence state. |
| `decisionTime` | `string` | yes | 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

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

### Input

`records`:

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

`decisionTime`:

```json
"2026-03-01T00:00:00Z"
```

### Call

```ts
calculate(records, decisionTime)
```

### Returns

object with 1 field: 9

```json
{
  "9": {
    "session_date": "2026-01-15",
    "new_highs": 2,
    "new_lows": 10,
    "value": 54.166666666666664,
    "status": "resolved",
    "reason": null
  }
}
```

## Verification and provenance

Tier: **verified** (via input-expected).

The worked example below is the figure published in this algorithm's article, replayed and asserted by the test suite on every build. The arithmetic cannot drift without the build failing.

Both tiers guarantee the signature. Full explanation: https://docs.thefintechbuilder.com/guides/verification/

Generated from the docs.json payload shipped inside fintech-algorithms@0.13.1.
The signature and parameter list are checked against the compiled implementation at build time,
so a description that contradicts the code fails the build rather than reaching this file.

## Links

- Article (how it works, step by step): https://thefintechbuilder.com/market-breadth-and-internals/high-low-and-trend-breadth/high-low-index/
- Implementation source: https://github.com/IslamBaraka90/Fintech-Algorithms-Library/blob/main/src/market-breadth-and-internals/high-low-and-trend-breadth/high-low-index/impl.ts
- Package on npm: https://www.npmjs.com/package/fintech-algorithms
- Domain index for agents: https://docs.thefintechbuilder.com/market-breadth-and-internals/llms.txt
