# banbox/banta architecture

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

- Interactive diagram: https://gitdiagram.com/banbox/banta
- Repository: https://github.com/banbox/banta

## Overview

BanTA is a dependency-free Go technical-analysis library for computing market indicators in either event-driven, state-caching mode or batch, parallel mode; it also exposes Python wrappers. The main workflow supplies candle data, updates a BarEnv or provides arrays, computes indicator series, and reads current or batch results. The graph groups the runtime API, indicator families, batch implementation, and Python bindings. README and sampled code support the principal modes and bindings; unsampled indicator families are represented at their known source paths, with no speculative call links.

Main entry points: [`core.go`](https://github.com/banbox/banta/blob/main/core.go) (Cached Series), [`indicators_moving.go`](https://github.com/banbox/banta/blob/main/indicators_moving.go) (Moving Averages), [`python/ta/index.go`](https://github.com/banbox/banta/blob/main/python/ta/index.go) (Streaming Wrapper), [`indicators_momentum.go`](https://github.com/banbox/banta/blob/main/indicators_momentum.go) (Momentum Indicators)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_stream["Stateful API"]
  node_barenv["Bar Environment<br/>[core.go]"]
  node_series[("Cached Series<br/>[core.go]")]
  node_utils["Core Utilities<br/>[utils.go]"]
end

subgraph group_indicators["Indicator Families"]
  node_moving["Moving Averages"]
  node_momentum["Momentum Indicators"]
  node_trend["Trend Indicators"]
  node_volume["Volume Indicators"]
  node_volatility["Volatility Indicators"]
  node_channels["Price Channels"]
  node_regression["Regression Indicators"]
  node_patterns["Pattern Indicators"]
  node_price["Price Indicators"]
  node_indicator_helpers["Indicator Helpers"]
end

subgraph group_batch["Batch API"]
  node_batch_indicators["Batch Indicators"]
  node_batch_moving["Batch Moving Averages"]
  node_batch_trend["Batch Trend"]
  node_batch_volume["Batch Volume"]
  node_batch_channels["Batch Channels"]
  node_batch_helpers["Batch Helpers"]
end

subgraph group_bindings["Python Bindings"]
  node_python_stream["Streaming Wrapper<br/>[index.go]"]
  node_python_batch["Batch Wrapper<br/>[index.go]"]
end

node_user(("Go Caller"))
node_candles["Candle Input"]
node_batch_user(("Batch Caller"))
node_arrays["Candle Arrays"]
node_python_user(("Python Caller"))

node_user -->|"supplies candles"| node_candles
node_candles -->|"updates"| node_barenv
node_barenv -->|"maintains series"| node_series
node_user -->|"requests indicators"| node_series
node_moving -->|"caches results"| node_series
node_momentum -->|"caches results"| node_series
node_trend -->|"caches results"| node_series
node_volume -->|"caches results"| node_series
node_volatility -->|"caches results"| node_series
node_channels -->|"caches results"| node_series
node_regression -->|"caches results"| node_series
node_patterns -.->|"returns results"| node_series
node_price -.->|"returns results"| node_series
node_indicator_helpers -.->|"supports calculations"| node_series
node_trend -->|"smooths values"| node_moving
node_momentum -->|"uses averages"| node_moving
node_channels -.->|"batch counterpart"| node_batch_channels
node_batch_user -->|"supplies arrays"| node_arrays
node_arrays -->|"computes batch"| node_batch_indicators
node_batch_user -->|"requests indicators"| node_batch_indicators
node_batch_moving -.->|"uses helpers"| node_batch_helpers
node_batch_trend -.->|"uses helpers"| node_batch_helpers
node_batch_volume -.->|"uses helpers"| node_batch_helpers
node_python_user -->|"calls wrapper"| node_python_stream
node_python_stream -->|"delegates"| node_moving
node_python_stream -->|"delegates"| node_momentum
node_python_user -->|"calls wrapper"| node_python_batch
node_python_batch -->|"delegates"| node_batch_indicators

click node_barenv "https://github.com/banbox/banta/blob/main/core.go"
click node_series "https://github.com/banbox/banta/blob/main/core.go"
click node_moving "https://github.com/banbox/banta/blob/main/indicators_moving.go"
click node_momentum "https://github.com/banbox/banta/blob/main/indicators_momentum.go"
click node_trend "https://github.com/banbox/banta/blob/main/indicators_trend.go"
click node_volume "https://github.com/banbox/banta/blob/main/indicators_volume.go"
click node_volatility "https://github.com/banbox/banta/blob/main/indicators_volatility.go"
click node_channels "https://github.com/banbox/banta/blob/main/indicators_channels.go"
click node_regression "https://github.com/banbox/banta/blob/main/indicators_regression.go"
click node_patterns "https://github.com/banbox/banta/blob/main/indicators_patterns.go"
click node_price "https://github.com/banbox/banta/blob/main/indicators_price.go"
click node_indicator_helpers "https://github.com/banbox/banta/blob/main/indicators_helpers.go"
click node_utils "https://github.com/banbox/banta/blob/main/utils.go"
click node_batch_indicators "https://github.com/banbox/banta/blob/main/tav/indicators_momentum.go"
click node_batch_moving "https://github.com/banbox/banta/blob/main/tav/indicators_moving.go"
click node_batch_trend "https://github.com/banbox/banta/blob/main/tav/indicators_trend.go"
click node_batch_volume "https://github.com/banbox/banta/blob/main/tav/indicators_volume.go"
click node_batch_channels "https://github.com/banbox/banta/blob/main/tav/indicators_channels.go"
click node_batch_helpers "https://github.com/banbox/banta/blob/main/tav/indicators_helpers.go"
click node_python_stream "https://github.com/banbox/banta/blob/main/python/ta/index.go"
click node_python_batch "https://github.com/banbox/banta/blob/main/python/tav/index.go"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_barenv,node_series,node_utils toneBlue
class node_moving,node_momentum,node_trend,node_volume,node_volatility,node_channels,node_regression,node_patterns,node_price,node_indicator_helpers toneAmber
class node_batch_indicators,node_batch_moving,node_batch_trend,node_batch_volume,node_batch_channels,node_batch_helpers toneMint
class node_python_stream,node_python_batch toneRose
class node_user,node_candles,node_batch_user,node_arrays,node_python_user toneIndigo
```

## Components

### Stateful API

- [Bar Environment](https://github.com/banbox/banta/blob/main/core.go): `core.go`
- [Cached Series](https://github.com/banbox/banta/blob/main/core.go): `core.go`
- [Core Utilities](https://github.com/banbox/banta/blob/main/utils.go): `utils.go`

### Indicator Families

- [Moving Averages](https://github.com/banbox/banta/blob/main/indicators_moving.go): `indicators_moving.go`
- [Momentum Indicators](https://github.com/banbox/banta/blob/main/indicators_momentum.go): `indicators_momentum.go`
- [Trend Indicators](https://github.com/banbox/banta/blob/main/indicators_trend.go): `indicators_trend.go`
- [Volume Indicators](https://github.com/banbox/banta/blob/main/indicators_volume.go): `indicators_volume.go`
- [Volatility Indicators](https://github.com/banbox/banta/blob/main/indicators_volatility.go): `indicators_volatility.go`
- [Price Channels](https://github.com/banbox/banta/blob/main/indicators_channels.go): `indicators_channels.go`
- [Regression Indicators](https://github.com/banbox/banta/blob/main/indicators_regression.go): `indicators_regression.go`
- [Pattern Indicators](https://github.com/banbox/banta/blob/main/indicators_patterns.go): `indicators_patterns.go`
- [Price Indicators](https://github.com/banbox/banta/blob/main/indicators_price.go): `indicators_price.go`
- [Indicator Helpers](https://github.com/banbox/banta/blob/main/indicators_helpers.go): `indicators_helpers.go`

### Batch API

- [Batch Indicators](https://github.com/banbox/banta/blob/main/tav/indicators_momentum.go): `tav/indicators_momentum.go`
- [Batch Moving Averages](https://github.com/banbox/banta/blob/main/tav/indicators_moving.go): `tav/indicators_moving.go`
- [Batch Trend](https://github.com/banbox/banta/blob/main/tav/indicators_trend.go): `tav/indicators_trend.go`
- [Batch Volume](https://github.com/banbox/banta/blob/main/tav/indicators_volume.go): `tav/indicators_volume.go`
- [Batch Channels](https://github.com/banbox/banta/blob/main/tav/indicators_channels.go): `tav/indicators_channels.go`
- [Batch Helpers](https://github.com/banbox/banta/blob/main/tav/indicators_helpers.go): `tav/indicators_helpers.go`

### Python Bindings

- [Streaming Wrapper](https://github.com/banbox/banta/blob/main/python/ta/index.go): `python/ta/index.go`
- [Batch Wrapper](https://github.com/banbox/banta/blob/main/python/tav/index.go): `python/tav/index.go`

### Other components

- **Go Caller**
- **Candle Input**
- **Batch Caller**
- **Candle Arrays**
- **Python Caller**

## Connections

- Go Caller → Candle Input: supplies candles (evidence: `readme.md`)
- Candle Input → Bar Environment: updates (evidence: `readme.md`)
- Bar Environment → Cached Series: maintains series (evidence: `readme.md`)
- Go Caller → Cached Series: requests indicators (evidence: `readme.md`)
- Moving Averages → Cached Series: caches results (evidence: `indicators_moving.go`)
- Momentum Indicators → Cached Series: caches results (evidence: `indicators_momentum.go`)
- Trend Indicators → Cached Series: caches results (evidence: `indicators_trend.go`)
- Volume Indicators → Cached Series: caches results (evidence: `indicators_volume.go`)
- Volatility Indicators → Cached Series: caches results (evidence: `indicators_volatility.go`)
- Price Channels → Cached Series: caches results (evidence: `indicators_channels.go`)
- Regression Indicators → Cached Series: caches results (evidence: `indicators_regression.go`)
- Pattern Indicators → Cached Series: returns results
- Price Indicators → Cached Series: returns results
- Indicator Helpers → Cached Series: supports calculations
- Trend Indicators → Moving Averages: smooths values (evidence: `indicators_trend.go`)
- Momentum Indicators → Moving Averages: uses averages (evidence: `indicators_momentum.go`)
- Price Channels → Batch Channels: batch counterpart
- Batch Caller → Candle Arrays: supplies arrays (evidence: `readme.md`)
- Candle Arrays → Batch Indicators: computes batch (evidence: `readme.md`)
- Batch Caller → Batch Indicators: requests indicators (evidence: `readme.md`)
- Batch Moving Averages → Batch Helpers: uses helpers
- Batch Trend → Batch Helpers: uses helpers
- Batch Volume → Batch Helpers: uses helpers
- Python Caller → Streaming Wrapper: calls wrapper (evidence: `python/ta/index.go`)
- Streaming Wrapper → Moving Averages: delegates (evidence: `python/ta/index.go`)
- Streaming Wrapper → Momentum Indicators: delegates (evidence: `python/ta/index.go`)
- Python Caller → Batch Wrapper: calls wrapper (evidence: `python/tav/index.go`)
- Batch Wrapper → Batch Indicators: delegates (evidence: `python/tav/index.go`)
