# Price-by-Volume Profile Construction

`D08-F06-A01` · Geometric Chart Patterns → Level Confluence and Zone Scoring · archetype `record-transform` · difficulty 3/5 · verification **contract**

Full page: https://docs.thefintechbuilder.com/geometric-chart-patterns/level-confluence-and-zone-scoring/price-by-volume-profile-construction/
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 { priceByVolumeProfileConstruction } from "fintech-algorithms/geometric-chart-patterns/level-confluence-and-zone-scoring/price-by-volume-profile-construction";
```

## Signature

```ts
priceByVolumeProfileConstruction(input)
```

Aggregates eligible point-in-time trades into deterministic tick-aligned price-by-volume bins.

## Parameters

| Name | Type | Required | Notes |
| --- | --- | --- | --- |
| `input` | `{ tick_size: number; bin_size_ticks: number; window_end: string; trades: { trade_id: string; timestamp: string; price: number; volume: number; final: boolean }[] }` | yes | Record containing `tick_size`, `bin_size_ticks`, `window_end`, and chronologically ordered unique trades. |

## Returns

`{ state, tick_size, bin_size_ticks, bin_width, total_volume, trade_count, eligible_trade_count, rows }`

One `calculated` profile record; each row contains bin index, bounds, midpoint, volume, and volume share.

## Errors

- When tick/bin settings, window time, trade identity, chronology, price, or volume is invalid — throws

## Complexity

Time `undefined`, space `undefined`.

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

`input`:

```json
{
  "tick_size": 0.25,
  "bin_size_ticks": 2,
  "window_end": "2026-08-03T10:30:00Z",
  "trades": [
    {
      "trade_id": "T01",
      "timestamp": "2026-08-03T10:00:00Z",
      "price": 99,
      "volume": 10,
      "final": true
    },
    {
      "trade_id": "T02",
      "timestamp": "2026-08-03T10:02:00Z",
      "price": 99.25,
      "volume": 15,
      "final": true
    },
    {
      "trade_id": "T03",
      "timestamp": "2026-08-03T10:04:00Z",
      "price": 99.5,
      "volume": 25,
      "final": true
    }
  ]
}
```

### Call

```ts
priceByVolumeProfileConstruction(input)
```

### Returns

object with 8 fields: state, tick_size, bin_size_ticks, bin_width, total_volume, trade_count, eligible_trade_count, rows

```json
{
  "state": "calculated",
  "tick_size": 0.25,
  "bin_size_ticks": 2,
  "bin_width": 0.5,
  "total_volume": 340,
  "trade_count": 12,
  "eligible_trade_count": 12,
  "rows": [
    {
      "bin_index": 198,
      "lower": 99,
      "upper": 99.5,
      "midpoint": 99.25,
      "volume": 25,
      "share": 0.073529411765
    },
    {
      "bin_index": 199,
      "lower": 99.5,
      "upper": 100,
      "midpoint": 99.75,
      "volume": 45,
      "share": 0.132352941176
    },
    {
      "bin_index": 200,
      "lower": 100,
      "upper": 100.5,
      "midpoint": 100.25,
      "volume": 152,
      "share": 0.447058823529
    }
  ]
}
```

## Other exports

`calculate`, `pocValueAreaHvnLvnDetection`, `fibonacciRetracementExtensionProjection`, `psychologicalRoundNumberLevelGeneration`, `multiSourceSupportResistanceZoneFusion`, `supportResistanceZoneStrengthDecayScoring`, `supportResistanceRoleReversalStateMachine`, `breakoutAndRetestDetection`, `marketWideZoneProximityScannerRanking`. 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: **contract**.

The module loads, the entry point is callable and its declared signature matches the compiled code. The example below is real captured output, but no independently published figure asserts the numbers.

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

Generated from the docs.json payload shipped inside fintech-algorithms@0.12.0.
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/geometric-chart-patterns/level-confluence-and-zone-scoring/price-by-volume-profile-construction/
- Implementation source: https://github.com/IslamBaraka90/Fintech-Algorithms-Library/blob/main/src/geometric-chart-patterns/level-confluence-and-zone-scoring/price-by-volume-profile-construction/impl.ts
- Package on npm: https://www.npmjs.com/package/fintech-algorithms
- Domain index for agents: https://docs.thefintechbuilder.com/geometric-chart-patterns/llms.txt
