# ishmael0/indicators architecture

> Architecture diagram of the GitHub repository ishmael0/indicators, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-05-05). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/ishmael0/indicators
- Repository: https://github.com/ishmael0/indicators

## Overview

##### Project type and purpose
- From the README and file tree, this is a standalone, open-source TypeScript library (@debut/indicators) providing a suite of streaming technical indicators for trading applications. It is neither a full-stack web app nor a microservice but a utility SDK that consumers import, instantiate, and call in a streaming candle-by-candle context.

##### File structure
- Root configuration:
- .eslintrc, .prettierrc, tsconfig.json, rollup.config.js (build)
- jest.config.js (unit tests)
- package.json (dependencies, scripts)
- Core source (src/):
- Top-level indicator modules (ac.ts, adx.ts, atr.ts, … wws.ts)
- A “providers” subdirectory with common building-block algorithms (circular-buffer, correlation, true-range, sampler, standard-deviation, etc.)
- A “trendlines” subdirectory with models & utilities for drawing trading trend lines
- A utils.ts file for miscellaneous helpers
- Entry point: index.ts (exports all indicators, utils, providers)
- Tests (tests/):
- One directory per indicator or provider, with .spec.ts files and sample Excel/JSON data for validation
- Documentation: docs/ folder with Markdown pages for AcceleratorOscillator, UniLevel, etc.

##### README for additional insights
- Streaming, minimal-state design for “nextValue” and “momentValue” methods
- High-performance focus (benchmarked vs. alternatives)
- Extensible architecture: consumers can mix and match built-in providers and write custom indicators

##### Detail without over-segmenting
- Build/test pipeline as separate but connected components.

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% Source Modules
    subgraph "Source Modules"
        direction TB
        Providers["Providers\n(src/providers/*)"]:::source
        Utils["Utils\n(src/utils.ts)"]:::source
        Indicators["Indicators\n(src/*.ts)\nnextValue / momentValue API"]:::source
        Trendlines["Trendlines\n(src/trendlines/*)"]:::source
    end

    %% Entry Point
    EntryPoint["Library Entry Point\n(index.ts)"]:::entry

    %% Tooling
    subgraph "Tooling"
        direction TB
        Rollup["Rollup Build\n(rollup.config.js)"]:::tooling
        Jest["Jest Config\n(jest.config.js)"]:::tooling
        TestsSuite["Test Suite\n(tests/)"]:::tooling
    end

    %% Package Artifact
    Package["npm Package\n(dist bundle)"]:::pkg

    %% Documentation
    Docs["Documentation\n(docs/)"]:::docs

    %% Dependencies
    Providers --> Indicators
    Utils --> Indicators
    Providers --> Trendlines
    Utils --> Trendlines

    Indicators --> EntryPoint
    Providers --> EntryPoint
    Trendlines --> EntryPoint
    Utils --> EntryPoint

    EntryPoint --> Rollup
    Rollup --> Package
    EntryPoint --> TestsSuite
    TestsSuite --> Providers
    TestsSuite --> Indicators
    TestsSuite --> Trendlines
    TestsSuite --> Utils

    Docs -.-> Providers
    Docs -.-> Indicators
    Docs -.-> Trendlines
    Docs -.-> Utils

    %% Click Events
    click EntryPoint "https://github.com/ishmael0/indicators/blob/master/index.ts"
    click Indicators "https://github.com/ishmael0/indicators/tree/master/src/"
    click Providers "https://github.com/ishmael0/indicators/tree/master/src/providers/"
    click Trendlines "https://github.com/ishmael0/indicators/tree/master/src/trendlines/"
    click Utils "https://github.com/ishmael0/indicators/blob/master/src/utils.ts"
    click Rollup "https://github.com/ishmael0/indicators/blob/master/rollup.config.js"
    click Jest "https://github.com/ishmael0/indicators/blob/master/jest.config.js"
    click TestsSuite "https://github.com/ishmael0/indicators/tree/master/tests/"
    click Docs "https://github.com/ishmael0/indicators/tree/master/docs/"

    %% Styles
    classDef source fill:#cce5ff,stroke:#004080,color:#000;
    classDef entry fill:#d0f0c0,stroke:#006400,color:#000;
    classDef tooling fill:#ffe5b4,stroke:#cc8400,color:#000;
    classDef pkg fill:#d3d3d3,stroke:#666,color:#000;
    classDef docs fill:#f2f2f2,stroke-dasharray: 5 5,color:#000;
```
