# Ratio-Adjusted Summation Index (RASI)

`D04-F02-A04` · Market Breadth and Internals → McClellan Family · archetype `record-transform` · difficulty 4/5 · verification **verified**

Full page: https://docs.thefintechbuilder.com/market-breadth-and-internals/mcclellan-family/ratio-adjusted-summation-index-rasi/
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/mcclellan-family/ratio-adjusted-summation-index-rasi";
```

## Signature

```ts
calculate(records, cutoff)
```

RASI: the summation index built on the ratio-adjusted oscillator. The variant most practitioners mean when they quote 'the summation index', and the only one whose historical thresholds hold up across eras.

## Parameters

| Name | Type | Required | Notes |
| --- | --- | --- | --- |
| `records` | `BreadthRecord[]` | yes | Session records with revision and event-type fields. |
| `cutoff` | `string` | yes | Point-in-time bound. Revisions arriving after the cutoff are ignored rather than applied, so the series is exactly what was computable at that moment. Breadth data is revised routinely, and a cumulative line silently rebuilt from revised inputs is not the line anyone traded. |

## Returns

`{ status, points, latest_oscillator, latest_index_value, seed_state, … }`

The RASI series with its seeding state.

## Errors

- When records cannot be ordered — reported in reason_codes 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-02",
    "session_sequence": 1,
    "effective_at": "2026-01-02T21:00:00Z",
    "available_at": "2026-01-02T21:20:00Z",
    "revision": 0,
    "event_type": "upsert",
    "source_evidence_state": "ready",
    "venue_id": "SYNTH-X",
    "universe_id": "SYNTH-STABLE-200",
    "methodology_id": "close-vs-comparable-prior-close-v1",
    "calendar_id": "SYNTH-WEEKDAY",
    "volume_unit": "shares",
    "volume_adjustment_basis": "reported-unadjusted",
    "advances": 100
  }
]
```

`cutoff`:

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

### Call

```ts
calculate(records, cutoff)
```

### Returns

object with 4 fields: status, latest_oscillator, latest_index_value, ignored_future_records

```json
{
  "status": "resolved",
  "latest_oscillator": null,
  "latest_index_value": null,
  "ignored_future_records": 0
}
```

## Other exports

`transformRecord`, `calculateValues`. Every module additionally exports `run` as an alias of its primary
function, and a `meta` object carrying its catalog id, domain, family, shape and article URL.

## 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/mcclellan-family/ratio-adjusted-summation-index-rasi/
- Implementation source: https://github.com/IslamBaraka90/Fintech-Algorithms-Library/blob/main/src/market-breadth-and-internals/mcclellan-family/ratio-adjusted-summation-index-rasi/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
