fintech-algorithms
Using a coding agent? Give it the skill: npx skills add IslamBaraka90/Fintech-Algorithms-Library What it does →

Psychological Round-Number Level Generation

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#

psychologicalRoundNumberLevelGeneration(input)

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

Parameters#

NameTypeNotes
input{ current_price: number; lower_bound: number; upper_bound: number; tick_size: number; base_unit: number }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 , space .

Worked example#

executed 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
{
  "current_price": 103.4,
  "lower_bound": 95,
  "upper_bound": 110,
  "tick_size": 0.1,
  "base_unit": 1
}

Call#

psychologicalRoundNumberLevelGeneration(input)

Returns#

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

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

This module also 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.

Diagrams#

Psychological Round-Number Level Generation — system map

How it works#

This page states the contract — how to call it correctly. The article explains the concept: why it works, and where it breaks.

Read the article →

References#

The rest of the Level Confluence and Zone Scoring family#