# Psychological Round-Number Level Generation

`D08-F06-A04` · 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/psychological-round-number-level-generation/
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 { psychologicalRoundNumberLevelGeneration } from "fintech-algorithms/geometric-chart-patterns/level-confluence-and-zone-scoring/psychological-round-number-level-generation";
```

## Signature

```ts
psychologicalRoundNumberLevelGeneration(input)
```

Generates tick-aligned round-number levels inside explicit bounds and labels their salience and distance from current price.

## Parameters

| Name | Type | Required | Notes |
| --- | --- | --- | --- |
| `input` | `{ current_price: number; lower_bound: number; upper_bound: number; tick_size: number; base_unit: number }` | yes | Record containing current price, lower/upper bounds, tick size, and an aligned base unit. |

## Returns

`{ state, base_unit, level_count, closest_level, levels }`

One `calculated` level record; every level reports class, salience weight, absolute distance, and basis-point distance.

## Errors

- When bounds are inconsistent, tick/base-unit values are invalid or misaligned, or the bounds contain no levels — 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
{
  "current_price": 103.4,
  "lower_bound": 95,
  "upper_bound": 110,
  "tick_size": 0.1,
  "base_unit": 1
}
```

### Call

```ts
psychologicalRoundNumberLevelGeneration(input)
```

### Returns

object with 5 fields: state, base_unit, level_count, closest_level, levels

```json
{
  "state": "calculated",
  "base_unit": 1,
  "level_count": 16,
  "closest_level": {
    "price": 103,
    "class": "minor",
    "salience_weight": 0.5,
    "distance": 0.4,
    "distance_bps": 38.684719535784
  },
  "levels": [
    {
      "price": 95,
      "class": "half",
      "salience_weight": 0.75,
      "distance": 8.4,
      "distance_bps": 812.379110251451
    },
    {
      "price": 96,
      "class": "minor",
      "salience_weight": 0.5,
      "distance": 7.4,
      "distance_bps": 715.667311411993
    },
    {
      "price": 97,
      "class": "minor",
      "salience_weight": 0.5,
      "distance": 6.4,
      "distance_bps": 618.955512572534
    }
  ]
}
```

## Other exports

`calculate`, `priceByVolumeProfileConstruction`, `pocValueAreaHvnLvnDetection`, `fibonacciRetracementExtensionProjection`, `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/psychological-round-number-level-generation/
- Implementation source: https://github.com/IslamBaraka90/Fintech-Algorithms-Library/blob/main/src/geometric-chart-patterns/level-confluence-and-zone-scoring/psychological-round-number-level-generation/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
