# Normalized Template Matching

`D08-F04-A01` · Geometric Chart Patterns → Pattern Matching · archetype `record-transform` · difficulty 2/5 · verification **contract**

Full page: https://docs.thefintechbuilder.com/geometric-chart-patterns/pattern-matching/normalized-template-matching/
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 { match } from "fintech-algorithms/geometric-chart-patterns/pattern-matching/normalized-template-matching";
```

## Signature

```ts
match()
```

## Worked example

This entry is a thin wrapper its test never calls directly, so it was invoked with the arguments its shared implementation received. Real output, not asserted against a published figure.

### Input

`argument 1`:

```json
[99.874987, 100.159243, 100.421014, 100.350703, 100.560173, 100.558238]
```

Showing 6 of 96 elements.

`argument 2`:

```json
[0, 1, 2.5, 4.5, 6, 5]
```

Showing 6 of 12 elements.

### Call

```ts
match()
```

### Returns

object with 7 fields: template_length, best_start, best_end, correlation, distance, profile, normalization

```json
{
  "template_length": 12,
  "best_start": 58,
  "best_end": 69,
  "correlation": 0.9999999999999999,
  "distance": 8.382057464382987e-15,
  "profile": [
    {
      "start": 0,
      "correlation": 0.5900738849254371,
      "distance": 3.136594771689436,
      "eligible": true
    },
    {
      "start": 1,
      "correlation": 0.3358103596358022,
      "distance": 3.9925620056225477,
      "eligible": true
    },
    {
      "start": 2,
      "correlation": -0.07196549176585781,
      "distance": 5.072195954651257,
      "eligible": true
    }
  ],
  "normalization": "population-z-score-per-window"
}
```

## 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/pattern-matching/normalized-template-matching/
- Implementation source: https://github.com/IslamBaraka90/Fintech-Algorithms-Library/blob/main/src/geometric-chart-patterns/pattern-matching/normalized-template-matching/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
