# Fibonacci Retracement and Extension Projection

`D08-F06-A03` · 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/fibonacci-retracement-extension-projection/
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 { fibonacciRetracementExtensionProjection } from "fintech-algorithms/geometric-chart-patterns/level-confluence-and-zone-scoring/fibonacci-retracement-extension-projection";
```

## Signature

```ts
fibonacciRetracementExtensionProjection(input)
```

Projects declared retracement and extension ratios from a directed price leg and snaps every level to the nearest tick.

## Parameters

| Name | Type | Required | Notes |
| --- | --- | --- | --- |
| `input` | `{ start_price: number; end_price: number; retracement_end_price: number; tick_size: number; retracement_ratios: number[]; extension_ratios: number[] }` | yes | Record containing leg anchors, retracement-end anchor, tick size, and non-empty retracement and extension ratio lists. |

## Returns

`{ state, direction, leg_size, retracement_levels, extension_levels, rounding }`

One `calculated` projection record; each level reports its ratio, raw price, and tick-snapped price.

## Errors

- When anchors coincide, tick size is invalid, ratios are empty, or ratios fall outside allowed ranges — 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
{
  "start_price": 100,
  "end_price": 120,
  "retracement_end_price": 112,
  "tick_size": 0.1,
  "retracement_ratios": [0.236, 0.382, 0.5, 0.618, 0.786],
  "extension_ratios": [1, 1.272, 1.618, 2]
}
```

### Call

```ts
fibonacciRetracementExtensionProjection(input)
```

### Returns

object with 6 fields: state, direction, leg_size, retracement_levels, extension_levels, rounding

```json
{
  "state": "calculated",
  "direction": "up",
  "leg_size": 20,
  "retracement_levels": [
    {
      "ratio": 0.236,
      "raw_price": 115.28,
      "price": 115.3
    },
    {
      "ratio": 0.382,
      "raw_price": 112.36,
      "price": 112.4
    },
    {
      "ratio": 0.5,
      "raw_price": 110,
      "price": 110
    }
  ],
  "extension_levels": [
    {
      "ratio": 1,
      "raw_price": 132,
      "price": 132
    },
    {
      "ratio": 1.272,
      "raw_price": 137.44,
      "price": 137.4
    },
    {
      "ratio": 1.618,
      "raw_price": 144.36,
      "price": 144.4
    }
  ],
  "rounding": "nearest tick, half away from zero"
}
```

## Other exports

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