# philgatex/trendiq-markets architecture

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

- Interactive diagram: https://gitdiagram.com/philgatex/trendiq-markets
- Repository: https://github.com/philgatex/trendiq-markets

## Overview

TrendIQ Markets is a Streamlit dashboard for multi-market monitoring, technical analysis, regime classification, prediction scoring, and risk planning. The principal workflow selects a market and data provider, loads price history and a market snapshot, computes indicators and regime signals, derives a prediction and trade levels, then presents charts and risk-planning controls. The README also describes TradingView charts, Twelve Data trend summaries, and optional Binance and MT5 connectors. Some app wiring and provider details are unsampled, so edges rely on shown imports/calls or README statements; optional integrations are marked dashed where wiring is unverified.

Main entry points: [`app.py`](https://github.com/philgatex/trendiq-markets/blob/main/app.py) (Streamlit Dashboard), [`modules/market_data.py`](https://github.com/philgatex/trendiq-markets/blob/main/modules/market_data.py) (Market Data), [`modules/indicators.py`](https://github.com/philgatex/trendiq-markets/blob/main/modules/indicators.py) (Technical Indicators), [`modules/crypto.py`](https://github.com/philgatex/trendiq-markets/blob/main/modules/crypto.py) (Crypto History)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_dashboard["Dashboard"]
  node_streamlit_app["Streamlit Dashboard<br/>[app.py]"]
  node_market_catalog["Market Selection<br/>[market_data.py]"]
  node_charts["Charts and Views<br/>[app.py]"]
end

subgraph group_analysis["Market Analysis"]
  node_indicators["Technical Indicators<br/>[indicators.py]"]
  node_regime["Market Regime"]
  node_prediction["Prediction Scoring"]
  node_trend_summary["Trend Summary<br/>[market_data.py]"]
end

subgraph group_connectors["Data Connectors"]
  node_market_data["Market Data<br/>[market_data.py]"]
  node_yahoo["Yahoo Finance"]
  node_twelve_data["Twelve Data"]
  node_crypto_data["Crypto History<br/>[crypto.py]"]
  node_ccxt["CCXT Exchange"]
  node_mt5["MT5 Connector<br/>[mt5_connector.py]"]
  node_tradingview["TradingView Widget"]
end

subgraph group_trading["Trade Planning"]
  node_risk_plan["Risk and Position Plan<br/>[risk_engine.py]"]
  node_binance_orders["Binance Order Scaffold<br/>[binance.py]"]
end

node_user(("Dashboard User"))

node_user -->|"uses"| node_streamlit_app
node_streamlit_app -->|"selects market"| node_market_catalog
node_streamlit_app -->|"loads prices"| node_market_data
node_market_catalog -->|"supplies symbols"| node_market_data
node_market_data -->|"fetches history"| node_yahoo
node_market_data -->|"requests data"| node_twelve_data
node_market_data -->|"dispatches crypto"| node_crypto_data
node_crypto_data -->|"fetches OHLCV"| node_ccxt
node_streamlit_app -->|"computes indicators"| node_indicators
node_streamlit_app -->|"builds regime"| node_regime
node_streamlit_app -->|"scores outlook"| node_prediction
node_indicators -->|"finds levels"| node_prediction
node_streamlit_app -->|"plans position"| node_risk_plan
node_streamlit_app -->|"loads trend"| node_trend_summary
node_trend_summary -->|"requests summary"| node_twelve_data
node_streamlit_app -->|"renders views"| node_charts
node_charts -.->|"embeds widget"| node_tradingview
node_user -.->|"may configure"| node_binance_orders
node_binance_orders -->|"places orders"| node_ccxt
node_user -.->|"may configure"| node_mt5

click node_streamlit_app "https://github.com/philgatex/trendiq-markets/blob/main/app.py"
click node_market_catalog "https://github.com/philgatex/trendiq-markets/blob/main/modules/market_data.py"
click node_charts "https://github.com/philgatex/trendiq-markets/blob/main/app.py"
click node_market_data "https://github.com/philgatex/trendiq-markets/blob/main/modules/market_data.py"
click node_crypto_data "https://github.com/philgatex/trendiq-markets/blob/main/modules/crypto.py"
click node_mt5 "https://github.com/philgatex/trendiq-markets/blob/main/modules/mt5_connector.py"
click node_indicators "https://github.com/philgatex/trendiq-markets/blob/main/modules/indicators.py"
click node_regime "https://github.com/philgatex/trendiq-markets/blob/main/modules/sentiment_engine.py"
click node_prediction "https://github.com/philgatex/trendiq-markets/blob/main/modules/prediction_engine.py"
click node_trend_summary "https://github.com/philgatex/trendiq-markets/blob/main/modules/market_data.py"
click node_risk_plan "https://github.com/philgatex/trendiq-markets/blob/main/modules/risk_engine.py"
click node_binance_orders "https://github.com/philgatex/trendiq-markets/blob/main/modules/binance.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_streamlit_app,node_market_catalog,node_charts,node_user toneBlue
class node_indicators,node_regime,node_prediction,node_trend_summary toneAmber
class node_market_data,node_yahoo,node_twelve_data,node_crypto_data,node_ccxt,node_mt5,node_tradingview toneMint
class node_risk_plan,node_binance_orders toneRose
```

## Components

### Dashboard

- [Streamlit Dashboard](https://github.com/philgatex/trendiq-markets/blob/main/app.py): `app.py`
- [Market Selection](https://github.com/philgatex/trendiq-markets/blob/main/modules/market_data.py): `modules/market_data.py`
- [Charts and Views](https://github.com/philgatex/trendiq-markets/blob/main/app.py): `app.py`

### Market Analysis

- [Technical Indicators](https://github.com/philgatex/trendiq-markets/blob/main/modules/indicators.py): `modules/indicators.py`
- [Market Regime](https://github.com/philgatex/trendiq-markets/blob/main/modules/sentiment_engine.py): `modules/sentiment_engine.py`
- [Prediction Scoring](https://github.com/philgatex/trendiq-markets/blob/main/modules/prediction_engine.py): `modules/prediction_engine.py`
- [Trend Summary](https://github.com/philgatex/trendiq-markets/blob/main/modules/market_data.py): `modules/market_data.py`

### Data Connectors

- [Market Data](https://github.com/philgatex/trendiq-markets/blob/main/modules/market_data.py): `modules/market_data.py`
- **Yahoo Finance**
- **Twelve Data**
- [Crypto History](https://github.com/philgatex/trendiq-markets/blob/main/modules/crypto.py): `modules/crypto.py`
- **CCXT Exchange**
- [MT5 Connector](https://github.com/philgatex/trendiq-markets/blob/main/modules/mt5_connector.py): `modules/mt5_connector.py`
- **TradingView Widget**

### Trade Planning

- [Risk and Position Plan](https://github.com/philgatex/trendiq-markets/blob/main/modules/risk_engine.py): `modules/risk_engine.py`
- [Binance Order Scaffold](https://github.com/philgatex/trendiq-markets/blob/main/modules/binance.py): `modules/binance.py`

### Other components

- **Dashboard User**

## Connections

- Dashboard User → Streamlit Dashboard: uses (evidence: `README.md`)
- Streamlit Dashboard → Market Selection: selects market (evidence: `app.py`)
- Streamlit Dashboard → Market Data: loads prices (evidence: `app.py`)
- Market Selection → Market Data: supplies symbols (evidence: `app.py`)
- Market Data → Yahoo Finance: fetches history (evidence: `modules/market_data.py`)
- Market Data → Twelve Data: requests data (evidence: `modules/market_data.py`)
- Market Data → Crypto History: dispatches crypto (evidence: `modules/market_data.py`)
- Crypto History → CCXT Exchange: fetches OHLCV (evidence: `modules/crypto.py`)
- Streamlit Dashboard → Technical Indicators: computes indicators (evidence: `app.py`)
- Streamlit Dashboard → Market Regime: builds regime (evidence: `app.py`)
- Streamlit Dashboard → Prediction Scoring: scores outlook (evidence: `app.py`)
- Technical Indicators → Prediction Scoring: finds levels (evidence: `modules/prediction_engine.py`)
- Streamlit Dashboard → Risk and Position Plan: plans position (evidence: `app.py`)
- Streamlit Dashboard → Trend Summary: loads trend (evidence: `app.py`)
- Trend Summary → Twelve Data: requests summary (evidence: `modules/market_data.py`)
- Streamlit Dashboard → Charts and Views: renders views (evidence: `app.py`)
- Charts and Views → TradingView Widget: embeds widget (evidence: `README.md`)
- Dashboard User → Binance Order Scaffold: may configure (evidence: `README.md`)
- Binance Order Scaffold → CCXT Exchange: places orders (evidence: `modules/binance.py`)
- Dashboard User → MT5 Connector: may configure (evidence: `README.md`)
