fintech-algorithms

Triple Top

Install and import

bash
npm install fintech-algorithms
ts
import { triple_top } from "fintech-algorithms/geometric-chart-patterns/reversal-structures/triple-top";

Signature

triple_top()

Worked example

executed 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
[100, 101.125, 102.25, 103.375, 104.5, 105.625]

Showing 6 of 72 elements.

Call

triple_top()

Returns

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

{
  "pattern": "triple_top",
  "state": "confirmed",
  "reason": "neckline-break-confirmed",
  "event": {
    "pattern": "triple_top",
    "pivot_indices": [14, 21, 28, 35, 42],
    "pivot_prices": [120, 110, 119.5, 111, 120.5],
    "pivot_types": ["high", "low", "high", "low", "high"],
    "candidate_available_index": 44,
    "confirmation_index": 50,
    "neckline": 112.07142857142857,
    "metrics": {
      "test_mean": 120,
      "level_spread": 0.008333333333333333,
      "retracement_min": 0.075,
      "head_dominance": null,
      "formation_bars": 28,
      "min_separation": 7
    },
    "prior_move": 0.09166666666666666,
    "state": "confirmed",
    "reason": "neckline-break-confirmed",
    "direction": "bearish"
  },
  "events": [
    {
      "pattern": "triple_top",
      "pivot_indices": [14, 21, 28, 35, 42],
      "pivot_prices": [120, 110, 119.5, 111, 120.5],
      "pivot_types": ["high", "low", "high", "low", "high"],
      "candidate_available_index": 44,
      "confirmation_index": 50,
      "neckline": 112.07142857142857,
      "metrics": {
        "test_mean": 120,
        "level_spread": 0.008333333333333333,
        "retracement_min": 0.075,
        "head_dominance": null,
        "formation_bars": 28,
        "min_separation": 7
      },
      "prior_move": 0.09166666666666666,
      "state": "confirmed",
      "reason": "neckline-break-confirmed",
      "direction": "bearish"
    }
  ],
  "pivots": [
    {
      "kind": "high",
      "index": 14,
      "confirmation_index": 16,
      "price": 120
    },
    {
      "kind": "low",
      "index": 21,
      "confirmation_index": 23,
      "price": 110
    },
    {
      "kind": "high",
      "index": 28,
      "confirmation_index": 30,
      "price": 119.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

This module also exports confirmedPivots, detectReversal, traceReversal, double_top, double_bottom, triple_bottom, head_and_shoulders, inverse_head_and_shoulders. 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

Triple Top — triple top anatomy

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

  • Claim-to-source map