# Force Index

`D07-F05-A06` · Technical Indicators → Volume Indicators · archetype `series-transform` · difficulty 3/5 · verification **verified**

Full page: https://docs.thefintechbuilder.com/technical-indicators/volume-indicators/force-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 { forceIndex } from "fintech-algorithms/technical-indicators/volume-indicators/force-index";
```

## Signature

```ts
forceIndex(close, volume, p)
```

Price change multiplied by volume, then smoothed. Combines direction, size and participation in one number — a large move on no volume scores low.

## Parameters

| Name | Type | Required | Notes |
| --- | --- | --- | --- |
| `close` | `number[]` | yes | Per-bar closing prices, chronological. |
| `volume` | `number[]` | yes | Per-bar traded volume, aligned index-for-index with the price series. |
| `p` | `number` | yes | EMA span applied to the raw force series. · min: 1, integer: true |

## Returns

`Record<string, (number | null)[]>` · length same-as-input

Parallel series: `change`, `volume`, `raw_force`, `ema_seed` and the smoothed `force_index`.

## Warm-up

The first `p` positions are `null`. One bar for the price change, then the EMA seed window.

## Errors

- When p < 1 or is not an integer — throws RangeError
- When the input series are not all the same length — throws RangeError

## 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

`close`:

```json
[100.28, 100.686113, 101.200346, 101.789282, 102.408843, 103.010585]
```

Showing 6 of 120 elements.

`volume`:

```json
[990000, 1066468.036, 1130033.236, 1170141.961, 1180511.26, 1160272.794]
```

Showing 6 of 120 elements.

### Call

```ts
forceIndex(close, volume, p)
```

### Returns

object with 5 fields: change, volume, raw_force, ema_seed, force_index

```json
{
  "change": [
    null,
    0.40611300000000483,
    0.5142329999999902,
    0.5889360000000039,
    0.6195610000000045,
    0.6017420000000016
  ],
  "volume": [990000, 1066468.036, 1130033.236, 1170141.961, 1180511.26, 1160272.794],
  "raw_force": [
    null,
    433106.53350407316,
    581100.3810479769,
    689138.7259435005,
    731398.7367568653,
    698184.8716071498
  ],
  "ema_seed": [null, null, null, null, null, null],
  "force_index": [null, null, null, null, null, null]
}
```

## Other exports

`obv`, `accumulationDistributionLine`, `chaikinMoneyFlow`, `moneyFlowIndex`, `volumePriceTrend`. 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 scenario-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/technical-indicators/volume-indicators/force-index/
- Implementation source: https://github.com/IslamBaraka90/Fintech-Algorithms-Library/blob/main/src/technical-indicators/volume-indicators/force-index/impl.ts
- Package on npm: https://www.npmjs.com/package/fintech-algorithms
- Domain index for agents: https://docs.thefintechbuilder.com/technical-indicators/llms.txt
