fintech-algorithms

Factor Diffusion Index

Install and import

bash
npm install fintech-algorithms
ts
import { calculate } from "fintech-algorithms/market-breadth-and-internals/concentration-and-diffusion/factor-diffusion-index";

Signature

calculate(rows, tolerance)

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

rows
[
  {
    "component_id": "Value",
    "signal_change": 0.014,
    "ready": true
  },
  {
    "component_id": "Momentum",
    "signal_change": 0.011,
    "ready": true
  },
  {
    "component_id": "Quality",
    "signal_change": 0.007,
    "ready": true
  }
]

Showing 3 of 8 elements.

tolerance
0.002

Call

calculate(rows, tolerance)

Returns

object with 6 fields: status, value, improving, unchanged, deteriorating, total

{
  "status": "resolved",
  "value": 62.5,
  "improving": 4,
  "unchanged": 2,
  "deteriorating": 2,
  "total": 8
}

Diagrams

Factor Diffusion Index — decision boundary
Factor Diffusion Index — family 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