# Triple Bottom

`D08-F02-A04` · Geometric Chart Patterns → Reversal Structures · archetype `record-transform` · difficulty 3/5 · verification **contract**

Full page: https://docs.thefintechbuilder.com/geometric-chart-patterns/reversal-structures/triple-bottom/
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 { tripleBottom } from "fintech-algorithms/geometric-chart-patterns/reversal-structures/triple-bottom";
```

## Signature

```ts
tripleBottom(close, params)
```

Triple bottom detection: three comparable lows, confirmed on a close above the neckline. Chart patterns are usually described in prose vague enough to fit almost anything; encoding one forces a decision about how close "comparable" is and how much confirmation is required, and this returns those tolerances alongside the verdict. Takes the close series and detection parameters, then delegates to the family detector core.

## Parameters

| Name | Type | Required | Notes |
| --- | --- | --- | --- |
| `close` | `number[]` | yes | Finite, strictly positive closes in chronological order. |
| `params` | `Record<string, number>` | no | Optional pivot, geometry, prior-trend, and confirmation overrides; unknown keys are rejected. · default: "{}" |

## Returns

`{ pattern, state, reason, event, events, pivots, parameters }`

A `state` rather than a boolean — searching, candidate, confirmed, or rejected — with the `reason`, the pivots that formed it, and the `parameters` in force. The parameters are the point: the same series yields a different answer under different tolerances, and a pattern reported without them cannot be reproduced.

## Errors

- When close is empty, non-finite, zero, or negative — throws an Error
- When a parameter is unknown or outside its accepted range — throws an Error
- When a valid non-empty series has insufficient confirmed pivots — returns state `searching` rather than throwing

## Complexity

Time `O(n)`, space `O(pivots)`.

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

`close`:

```json
[120, 118.875, 117.75, 116.625, 115.5, 114.375]
```

Showing 6 of 72 elements.

### Call

```ts
tripleBottom(close, params)
```

### Returns

object with 7 fields: pattern, state, reason, event, events, pivots, parameters

```json
{
  "pattern": "triple_bottom",
  "state": "confirmed",
  "reason": "neckline-break-confirmed",
  "event": {
    "pattern": "triple_bottom",
    "pivot_indices": [14, 21, 28, 35, 42],
    "pivot_prices": [100, 110, 100.5, 109, 99.5],
    "pivot_types": ["low", "high", "low", "high", "low"],
    "candidate_available_index": 44,
    "confirmation_index": 50,
    "neckline": 107.92857142857143,
    "metrics": {
      "test_mean": 100,
      "level_spread": 0.01,
      "retracement_min": 0.09,
      "head_dominance": null,
      "formation_bars": 28,
      "min_separation": 7
    },
    "prior_move": 0.11,
    "state": "confirmed",
    "reason": "neckline-break-confirmed",
    "direction": "bullish"
  },
  "events": [
    {
      "pattern": "triple_bottom",
      "pivot_indices": [14, 21, 28, 35, 42],
      "pivot_prices": [100, 110, 100.5, 109, 99.5],
      "pivot_types": ["low", "high", "low", "high", "low"],
      "candidate_available_index": 44,
      "confirmation_index": 50,
      "neckline": 107.92857142857143,
      "metrics": {
        "test_mean": 100,
        "level_spread": 0.01,
        "retracement_min": 0.09,
        "head_dominance": null,
        "formation_bars": 28,
        "min_separation": 7
      },
      "prior_move": 0.11,
      "state": "confirmed",
      "reason": "neckline-break-confirmed",
      "direction": "bullish"
    }
  ],
  "pivots": [
    {
      "kind": "low",
      "index": 14,
      "confirmation_index": 16,
      "price": 100
    },
    {
      "kind": "high",
      "index": 21,
      "confirmation_index": 23,
      "price": 110
    },
    {
      "kind": "low",
      "index": 28,
      "confirmation_index": 30,
      "price": 100.5
    }
  ],
  "parameters": {
    "pivot_left": 2,
    "pivot_right": 2,
    "min_swing_bars": 5,
    "max_pattern_bars": 40,
    "max_confirmation_bars": 15,
    "trend_lookback": 6,
    "level_tolerance": 0.025,
    "shoulder_tolerance": 0.025,
    "min_retracement": 0.05,
    "head_margin": 0.05,
    "min_prior_trend": 0.03,
    "break_buffer": 0
  }
}
```

## Other exports

`confirmedPivots`, `detectReversal`, `traceReversal`. 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.13.1.
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/reversal-structures/triple-bottom/
- Implementation source: https://github.com/IslamBaraka90/Fintech-Algorithms-Library/blob/main/src/geometric-chart-patterns/reversal-structures/triple-bottom/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
