# jicheolha/crypto-trading-bot architecture

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

- Interactive diagram: https://gitdiagram.com/jicheolha/crypto-trading-bot
- Repository: https://github.com/jicheolha/crypto-trading-bot

## Overview

Keltrader is a crypto breakout-trading system: historical market data feeds indicator-based squeeze signals, which are evaluated through backtesting and parameter search; documented live trading executes trades and sends Telegram notifications. The visible tree does not contain the README’s redacted live-trading or signal-generator modules, so those capabilities are shown without invented source paths. The excerpts support data caching, technical analysis, backtesting, optimization, and permutation testing; live execution details remain undocumented here.

Main entry points: [`optimize_lib.py`](https://github.com/jicheolha/crypto-trading-bot/blob/main/optimize_lib.py) (Parameter optimization), [`data_utils.py`](https://github.com/jicheolha/crypto-trading-bot/blob/main/data_utils.py) (Market data loader), [`backtester.py`](https://github.com/jicheolha/crypto-trading-bot/blob/main/backtester.py) (Backtesting engine), [`technical.py`](https://github.com/jicheolha/crypto-trading-bot/blob/main/technical.py) (Squeeze indicators)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_market["Market data and signals"]
  node_data["Market data loader<br/>[data_utils.py]"]
  node_cache[("Local data cache<br/>[data_utils.py]")]
  node_indicators["Squeeze indicators<br/>[technical.py]"]
  node_signals["Signal generation"]
end

subgraph group_strategy["Strategy evaluation"]
  node_backtest["Backtesting engine<br/>[backtester.py]"]
  node_optimization["Parameter optimization<br/>[optimize_lib.py]"]
  node_timeframe_search["Timeframe search<br/>[optimize.py]"]
  node_trial_store[("Optimization history")]
  node_permutation["Permutation testing"]
end

subgraph group_execution["Live trading"]
  node_live["Live trading engine"]
end

node_operator(("Trader / researcher"))
node_alpaca["Alpaca data API"]
node_coinbase["Coinbase exchange"]
node_telegram["Telegram notifications"]

node_operator -->|"requests data"| node_data
node_data -->|"reads / writes"| node_cache
node_data -->|"fetches bars"| node_alpaca
node_indicators -.->|"informs signals"| node_signals
node_backtest -->|"imports analyzer"| node_indicators
node_backtest -->|"generates signals"| node_signals
node_operator -->|"runs simulation"| node_backtest
node_operator -->|"tunes strategy"| node_optimization
node_optimization -->|"scores parameters"| node_backtest
node_optimization -->|"constructs analyzer"| node_indicators
node_optimization -->|"uses market data"| node_data
node_timeframe_search -->|"runs studies"| node_optimization
node_optimization -->|"persists trials"| node_trial_store
node_operator -->|"tests robustness"| node_permutation
node_operator -.->|"starts trading"| node_live
node_live -.->|"trades futures"| node_coinbase
node_live -.->|"uses signals"| node_signals
node_live -.->|"sends alerts"| node_telegram

click node_data "https://github.com/jicheolha/crypto-trading-bot/blob/main/data_utils.py"
click node_cache "https://github.com/jicheolha/crypto-trading-bot/blob/main/data_utils.py"
click node_indicators "https://github.com/jicheolha/crypto-trading-bot/blob/main/technical.py"
click node_backtest "https://github.com/jicheolha/crypto-trading-bot/blob/main/backtester.py"
click node_optimization "https://github.com/jicheolha/crypto-trading-bot/blob/main/optimize_lib.py"
click node_timeframe_search "https://github.com/jicheolha/crypto-trading-bot/blob/main/optimize.py"
click node_permutation "https://github.com/jicheolha/crypto-trading-bot/blob/main/permutation_test.py"

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_data,node_cache,node_indicators,node_signals toneBlue
class node_backtest,node_optimization,node_timeframe_search,node_trial_store,node_permutation toneAmber
class node_live,node_alpaca toneMint
class node_operator,node_coinbase,node_telegram toneIndigo
```

## Components

### Market data and signals

- [Market data loader](https://github.com/jicheolha/crypto-trading-bot/blob/main/data_utils.py): `data_utils.py`
- [Local data cache](https://github.com/jicheolha/crypto-trading-bot/blob/main/data_utils.py): `data_utils.py`
- [Squeeze indicators](https://github.com/jicheolha/crypto-trading-bot/blob/main/technical.py): `technical.py`
- **Signal generation**

### Strategy evaluation

- [Backtesting engine](https://github.com/jicheolha/crypto-trading-bot/blob/main/backtester.py): `backtester.py`
- [Parameter optimization](https://github.com/jicheolha/crypto-trading-bot/blob/main/optimize_lib.py): `optimize_lib.py`
- [Timeframe search](https://github.com/jicheolha/crypto-trading-bot/blob/main/optimize.py): `optimize.py`
- **Optimization history**
- [Permutation testing](https://github.com/jicheolha/crypto-trading-bot/blob/main/permutation_test.py): `permutation_test.py`

### Live trading

- **Live trading engine**

### Other components

- **Trader / researcher**
- **Alpaca data API**
- **Coinbase exchange**
- **Telegram notifications**

## Connections

- Trader / researcher → Market data loader: requests data (evidence: `README.md`)
- Market data loader → Local data cache: reads / writes (evidence: `data_utils.py`)
- Market data loader → Alpaca data API: fetches bars (evidence: `data_utils.py`)
- Squeeze indicators → Signal generation: informs signals (evidence: `README.md`)
- Backtesting engine → Squeeze indicators: imports analyzer (evidence: `backtester.py`)
- Backtesting engine → Signal generation: generates signals (evidence: `backtester.py`)
- Trader / researcher → Backtesting engine: runs simulation (evidence: `README.md`)
- Trader / researcher → Parameter optimization: tunes strategy (evidence: `README.md`)
- Parameter optimization → Backtesting engine: scores parameters (evidence: `optimize_lib.py`)
- Parameter optimization → Squeeze indicators: constructs analyzer (evidence: `optimize_lib.py`)
- Parameter optimization → Market data loader: uses market data (evidence: `optimize_lib.py`)
- Timeframe search → Parameter optimization: runs studies (evidence: `optimize.py`)
- Parameter optimization → Optimization history: persists trials (evidence: `optimize_lib.py`)
- Trader / researcher → Permutation testing: tests robustness (evidence: `README.md`)
- Trader / researcher → Live trading engine: starts trading (evidence: `README.md`)
- Live trading engine → Coinbase exchange: trades futures (evidence: `README.md`)
- Live trading engine → Signal generation: uses signals (evidence: `README.md`)
- Live trading engine → Telegram notifications: sends alerts (evidence: `README.md`)
