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

Multi-Source Support/Resistance Zone Fusion

Install and import#

bash
npm install fintech-algorithms
ts
import { multiSourceSupportResistanceZoneFusion } from "fintech-algorithms/geometric-chart-patterns/level-confluence-and-zone-scoring/multi-source-support-resistance-zone-fusion";

Signature#

multiSourceSupportResistanceZoneFusion(input)

Clusters nearby levels, computes deterministic zone centers, and separates accepted multi-source zones from rejected clusters.

Parameters#

NameTypeNotes
input{ fusion_tolerance: number; minimum_sources: number; levels: { level_id: string; source: string; price: number; weight: number }[] }Record containing non-empty uniquely identified levels, fusion tolerance, and minimum distinct-source count.

Returns#

{ state, zones, rejected_clusters, fusion_tolerance, minimum_sources }

One calculated fusion record with ranked accepted zones and reason-coded rejected clusters.

Errors#

  • When levels are empty, identities repeat, source/price/weight fields are invalid, or fusion settings are invalid — 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
{
  "fusion_tolerance": 0.25,
  "minimum_sources": 2,
  "levels": [
    {
      "level_id": "PIV-1",
      "source": "pivot",
      "price": 99.8,
      "weight": 0.9
    },
    {
      "level_id": "FIB-1",
      "source": "fibonacci",
      "price": 100.1,
      "weight": 0.7
    },
    {
      "level_id": "RND-1",
      "source": "round-number",
      "price": 100,
      "weight": 0.8
    }
  ]
}

Call#

multiSourceSupportResistanceZoneFusion(input)

Returns#

object with 5 fields: state, zones, rejected_clusters, fusion_tolerance, minimum_sources

{
  "state": "calculated",
  "zones": [
    {
      "zone_id": "Z01",
      "lower": 99.55,
      "upper": 100.45,
      "center": 100.026470588235,
      "source_count": 4,
      "sources": ["fibonacci", "pivot", "round-number", "volume-profile"],
      "weight_sum": 3.4,
      "member_ids": ["PIV-1", "RND-1", "FIB-1", "VOL-1"]
    }
  ],
  "rejected_clusters": [
    {
      "zone_id": "Z02",
      "lower": 104.75,
      "upper": 105.25,
      "center": 105,
      "source_count": 1,
      "sources": ["pivot"],
      "weight_sum": 0.6,
      "member_ids": ["PIV-2"],
      "reason": "insufficient-distinct-sources"
    }
  ],
  "fusion_tolerance": 0.25,
  "minimum_sources": 2
}

Other exports#

This module also exports calculate, priceByVolumeProfileConstruction, pocValueAreaHvnLvnDetection, fibonacciRetracementExtensionProjection, psychologicalRoundNumberLevelGeneration, 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#

Multi-Source Support/Resistance Zone Fusion — 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#