# Cumulative TICK

`D04-F04-A05` · Market Breadth and Internals → Thrust and Pressure · archetype `record-transform` · difficulty 4/5 · verification **verified**

Full page: https://docs.thefintechbuilder.com/market-breadth-and-internals/thrust-and-pressure/cumulative-tick/
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/thrust-and-pressure/cumulative-tick";
```

## Signature

```ts
calculate(rows, seed, intervalSeconds)
```

Accumulates the net count of issues trading on an uptick versus a downtick. An intraday pressure gauge — it measures the balance of buying and selling *urgency* within the session rather than the outcome at the close.

## Parameters

| Name | Type | Required | Notes |
| --- | --- | --- | --- |
| `rows` | `TickRow[]` | yes | Intraday observations of uptick, downtick and neutral issue counts. Rows carry a `ready` flag; a row that is not ready is excluded rather than treated as zero, because a missing count and a count of zero mean opposite things about market breadth. |
| `seed` | `number` | yes | Starting value of the accumulation. |
| `intervalSeconds` | `number` | yes | Sampling interval of the observations, recorded so a series sampled at one rate is not compared with one sampled at another. · min: 1 |

## Returns

`{ status, value, interval_seconds, series }`

The cumulative series with the interval it was sampled at.

## Errors

- When intervalSeconds is not positive — throws

## Complexity

Time `O(n)`, space `O(n)`.

## Worked example

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`:

```json
[
  {
    "timestamp": "2026-01-05T09:30:00-05:00",
    "session_id": "XNYS-2026-01-05",
    "uptick_issues": 560,
    "downtick_issues": 440,
    "neutral_issues": 20,
    "ready": true
  },
  {
    "timestamp": "2026-01-05T09:31:00-05:00",
    "session_id": "XNYS-2026-01-05",
    "uptick_issues": 470,
    "downtick_issues": 530,
    "neutral_issues": 20,
    "ready": true
  },
  {
    "timestamp": "2026-01-05T09:32:00-05:00",
    "session_id": "XNYS-2026-01-05",
    "uptick_issues": 540,
    "downtick_issues": 460,
    "neutral_issues": 20,
    "ready": true
  }
]
```

Showing 3 of 36 elements.

`seed`:

```json
0
```

`intervalSeconds`:

```json
60
```

### Call

```ts
calculate(rows, seed, intervalSeconds)
```

### Returns

object with 4 fields: status, value, interval_seconds, series

```json
{
  "status": "resolved",
  "value": 1380,
  "interval_seconds": 60,
  "series": [
    {
      "timestamp": "2026-01-05T09:30:00-05:00",
      "tick": 120,
      "value": 120
    },
    {
      "timestamp": "2026-01-05T09:31:00-05:00",
      "tick": -60,
      "value": 60
    },
    {
      "timestamp": "2026-01-05T09:32:00-05:00",
      "tick": 80,
      "value": 140
    }
  ]
}
```

## Verification and provenance

Tier: **verified** (via row-fixture).

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/thrust-and-pressure/cumulative-tick/
- Implementation source: https://github.com/IslamBaraka90/Fintech-Algorithms-Library/blob/main/src/market-breadth-and-internals/thrust-and-pressure/cumulative-tick/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
