# endugi1/bitcoin-lstm-predictor architecture

> Architecture diagram of the GitHub repository endugi1/bitcoin-lstm-predictor, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-27). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/endugi1/bitcoin-lstm-predictor
- Repository: https://github.com/endugi1/bitcoin-lstm-predictor

## Overview

Bitcoin Intraday Forecast is a Streamlit dashboard that fetches 15-minute BTC candles, computes RSI/MACD inputs, and uses a fitted scaler and stacked LSTM to forecast the next close. The app also tracks forecasts for later verification and metrics, supports historical backtesting and an opt-in TradingView chart, and can send Telegram alerts. The sampled source is partial and most runtime behavior resides in app.py, so the graph follows documented capabilities while omitting uncertain internal sequencing.

Main entry points: [`app.py`](https://github.com/endugi1/bitcoin-lstm-predictor/blob/main/app.py) (Dashboard workflow), [`model_bitcoin_v1_4features.keras`](https://github.com/endugi1/bitcoin-lstm-predictor/blob/main/model_bitcoin_v1_4features.keras) (LSTM forecast model), [`config.py`](https://github.com/endugi1/bitcoin-lstm-predictor/blob/main/config.py) (Forecast settings), [`scaler_bitcoin_v1.pkl`](https://github.com/endugi1/bitcoin-lstm-predictor/blob/main/scaler_bitcoin_v1.pkl) (Feature scaler)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_live["Live Forecast"]
  node_app["Dashboard workflow<br/>[app.py]"]
  node_config["Forecast settings<br/>[config.py]"]
  node_indicators["RSI and MACD<br/>[app.py]"]
  node_scaler["Feature scaler"]
  node_model["LSTM forecast model"]
end

subgraph group_tracking["Tracking and Analysis"]
  node_backtest["Historical backtest<br/>[app.py]"]
  node_tracker["Forecast tracking<br/>[app.py]"]
  node_trackerdata[("Forecast history")]
  node_metrics["Accuracy metrics<br/>[app.py]"]
end

subgraph group_integrations["External Integrations"]
  node_binance["Binance candles"]
  node_yahoo["Yahoo Finance candles"]
  node_tradingview["TradingView chart"]
  node_alerts["Alert dispatch<br/>[app.py]"]
end

subgraph group_presentation["Dashboard Presentation"]
  node_chart["Forecast charts<br/>[app.py]"]
  node_styles["Quiet Quant styling<br/>[styles.py]"]
end

node_user(("Dashboard user"))
node_streamlit["Streamlit app"]
node_telegram["Telegram Bot API"]

node_user -->|"uses"| node_streamlit
node_streamlit -->|"runs"| node_app
node_app -->|"reads settings"| node_config
node_app -->|"fetches candles"| node_binance
node_app -.->|"fallback fetch"| node_yahoo
node_app -->|"computes features"| node_indicators
node_app -->|"transforms features"| node_scaler
node_app -->|"predicts"| node_model
node_app -->|"runs backtest"| node_backtest
node_backtest -->|"batch inference"| node_model
node_app -->|"records forecasts"| node_tracker
node_tracker -->|"reads and writes"| node_trackerdata
node_app -->|"calculates metrics"| node_metrics
node_metrics -->|"reads history"| node_trackerdata
node_app -->|"renders charts"| node_chart
node_app -.->|"embeds chart"| node_tradingview
node_app -->|"checks alert settings"| node_alerts
node_alerts -.->|"sends alerts"| node_telegram
node_app -->|"uses theme"| node_styles
node_streamlit -->|"displays dashboard"| node_user

click node_app "https://github.com/endugi1/bitcoin-lstm-predictor/blob/main/app.py"
click node_config "https://github.com/endugi1/bitcoin-lstm-predictor/blob/main/config.py"
click node_indicators "https://github.com/endugi1/bitcoin-lstm-predictor/blob/main/app.py"
click node_scaler "https://github.com/endugi1/bitcoin-lstm-predictor/blob/main/scaler_bitcoin_v1.pkl"
click node_model "https://github.com/endugi1/bitcoin-lstm-predictor/blob/main/model_bitcoin_v1_4features.keras"
click node_backtest "https://github.com/endugi1/bitcoin-lstm-predictor/blob/main/app.py"
click node_tracker "https://github.com/endugi1/bitcoin-lstm-predictor/blob/main/app.py"
click node_metrics "https://github.com/endugi1/bitcoin-lstm-predictor/blob/main/app.py"
click node_chart "https://github.com/endugi1/bitcoin-lstm-predictor/blob/main/app.py"
click node_alerts "https://github.com/endugi1/bitcoin-lstm-predictor/blob/main/app.py"
click node_styles "https://github.com/endugi1/bitcoin-lstm-predictor/blob/main/styles.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_app,node_config,node_indicators,node_scaler,node_model,node_user toneBlue
class node_backtest,node_tracker,node_trackerdata,node_metrics toneAmber
class node_binance,node_yahoo,node_tradingview,node_alerts,node_telegram toneMint
class node_chart,node_styles toneRose
class node_streamlit toneIndigo
```

## Components

### Live Forecast

- [Dashboard workflow](https://github.com/endugi1/bitcoin-lstm-predictor/blob/main/app.py): `app.py`
- [Forecast settings](https://github.com/endugi1/bitcoin-lstm-predictor/blob/main/config.py): `config.py`
- [RSI and MACD](https://github.com/endugi1/bitcoin-lstm-predictor/blob/main/app.py): `app.py`
- [Feature scaler](https://github.com/endugi1/bitcoin-lstm-predictor/blob/main/scaler_bitcoin_v1.pkl): `scaler_bitcoin_v1.pkl`
- [LSTM forecast model](https://github.com/endugi1/bitcoin-lstm-predictor/blob/main/model_bitcoin_v1_4features.keras): `model_bitcoin_v1_4features.keras`

### Tracking and Analysis

- [Historical backtest](https://github.com/endugi1/bitcoin-lstm-predictor/blob/main/app.py): `app.py`
- [Forecast tracking](https://github.com/endugi1/bitcoin-lstm-predictor/blob/main/app.py): `app.py`
- **Forecast history**
- [Accuracy metrics](https://github.com/endugi1/bitcoin-lstm-predictor/blob/main/app.py): `app.py`

### External Integrations

- **Binance candles**
- **Yahoo Finance candles**
- **TradingView chart**
- [Alert dispatch](https://github.com/endugi1/bitcoin-lstm-predictor/blob/main/app.py): `app.py`

### Dashboard Presentation

- [Forecast charts](https://github.com/endugi1/bitcoin-lstm-predictor/blob/main/app.py): `app.py`
- [Quiet Quant styling](https://github.com/endugi1/bitcoin-lstm-predictor/blob/main/styles.py): `styles.py`

### Other components

- **Dashboard user**
- **Streamlit app**
- **Telegram Bot API**

## Connections

- Dashboard user → Streamlit app: uses
- Streamlit app → Dashboard workflow: runs
- Dashboard workflow → Forecast settings: reads settings
- Dashboard workflow → Binance candles: fetches candles
- Dashboard workflow → Yahoo Finance candles: fallback fetch
- Dashboard workflow → RSI and MACD: computes features
- Dashboard workflow → Feature scaler: transforms features
- Dashboard workflow → LSTM forecast model: predicts
- Dashboard workflow → Historical backtest: runs backtest
- Historical backtest → LSTM forecast model: batch inference
- Dashboard workflow → Forecast tracking: records forecasts
- Forecast tracking → Forecast history: reads and writes
- Dashboard workflow → Accuracy metrics: calculates metrics
- Accuracy metrics → Forecast history: reads history
- Dashboard workflow → Forecast charts: renders charts
- Dashboard workflow → TradingView chart: embeds chart
- Dashboard workflow → Alert dispatch: checks alert settings
- Alert dispatch → Telegram Bot API: sends alerts
- Dashboard workflow → Quiet Quant styling: uses theme
- Streamlit app → Dashboard user: displays dashboard
