# suryapranav2k5/intraday-trading-intelligence-platform architecture

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

- Interactive diagram: https://gitdiagram.com/suryapranav2k5/intraday-trading-intelligence-platform
- Repository: https://github.com/suryapranav2k5/intraday-trading-intelligence-platform

## Overview

This is a real-time intraday trading intelligence and trade-supervision platform for Indian equities. Its principal workflow streams market data, maintains candle state, computes features and entry probabilities, manages trade exits, and sends live telemetry to a dashboard. The README also documents standalone order-book collection and model-training capabilities. Several links are explicit in the README or sampled source; unsampled frontend wiring and some subsystem connections are not asserted.

Main entry points: [`app.py`](https://github.com/suryapranav2k5/intraday-trading-intelligence-platform/blob/main/app.py) (Trading backend), [`inference.py`](https://github.com/suryapranav2k5/intraday-trading-intelligence-platform/blob/main/inference.py) (Entry inference), [`Web/src/pages/Index.tsx`](https://github.com/suryapranav2k5/intraday-trading-intelligence-platform/blob/main/Web/src/pages/Index.tsx) (Trading dashboard), [`SmartApi/realtime_data_hub.py`](https://github.com/suryapranav2k5/intraday-trading-intelligence-platform/blob/main/SmartApi/realtime_data_hub.py) (Realtime data hub)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_ingestion["Market ingestion"]
  node_smartclient["SmartAPI client<br/>[smartapi_client.py]"]
  node_symbolmap["Symbol mapping<br/>[symbol_utils.py]"]
  node_datahub["Realtime data hub"]
  node_harvester["Orderflow harvester"]
end

subgraph group_models["Trading intelligence"]
  node_features["Feature engineering"]
  node_entry["Entry inference<br/>[inference.py]"]
  node_entryengine["Entry ensemble<br/>[entry_inference.py]"]
  node_exitmanager["Live exit manager"]
  node_transformer["Exit transformer"]
end

subgraph group_service["Live service"]
  node_cache[("Candle cache<br/>[app.py]")]
  node_backend["Trading backend<br/>[app.py]"]
end

subgraph group_dashboard["Supervision dashboard"]
  node_clientdata["Trading data hook<br/>[useTradingData.ts]"]
  node_supervisionhook["Supervision hook"]
  node_dashboard["Trading dashboard<br/>[Index.tsx]"]
  node_supervisionpanel["Phase 2 panel"]
end

subgraph group_research["Model development"]
  node_training["Entry model training<br/>[train_universal.py]"]
  node_exittraining["Exit model training"]
end

node_trader(("Trading operator"))
node_broker{{"Angel One SmartAPI"}}

node_trader -->|"views telemetry"| node_dashboard
node_broker -->|"streams market data"| node_smartclient
node_smartclient -->|"provides stream"| node_datahub
node_symbolmap -->|"maps symbols"| node_datahub
node_datahub -->|"supplies market data"| node_backend
node_broker -->|"provides depth feed"| node_harvester
node_harvester -->|"subscribes to feed"| node_broker
node_backend -->|"updates candles"| node_cache
node_backend -->|"runs inference"| node_entry
node_entry -->|"computes features"| node_features
node_entry -->|"provides trade context"| node_exitmanager
node_exitmanager -->|"uses model"| node_transformer
node_backend -->|"requests exit decision"| node_exitmanager
node_backend -->|"emits telemetry"| node_dashboard
node_dashboard -.->|"reads trading state"| node_clientdata
node_dashboard -->|"renders supervision"| node_supervisionpanel
node_supervisionpanel -.->|"uses supervision state"| node_supervisionhook
node_entryengine -->|"consumes features"| node_features
node_training -.->|"trains entry models"| node_entry
node_exittraining -->|"trains exit model"| node_transformer

click node_smartclient "https://github.com/suryapranav2k5/intraday-trading-intelligence-platform/blob/main/SmartApi/smartapi_client.py"
click node_symbolmap "https://github.com/suryapranav2k5/intraday-trading-intelligence-platform/blob/main/SmartApi/symbol_utils.py"
click node_datahub "https://github.com/suryapranav2k5/intraday-trading-intelligence-platform/blob/main/SmartApi/realtime_data_hub.py"
click node_harvester "https://github.com/suryapranav2k5/intraday-trading-intelligence-platform/blob/main/orderflow_harvester.py"
click node_cache "https://github.com/suryapranav2k5/intraday-trading-intelligence-platform/blob/main/app.py"
click node_features "https://github.com/suryapranav2k5/intraday-trading-intelligence-platform/blob/main/feature_engineering.py"
click node_entry "https://github.com/suryapranav2k5/intraday-trading-intelligence-platform/blob/main/inference.py"
click node_entryengine "https://github.com/suryapranav2k5/intraday-trading-intelligence-platform/blob/main/entry_inference.py"
click node_exitmanager "https://github.com/suryapranav2k5/intraday-trading-intelligence-platform/blob/main/live_exit_engine.py"
click node_transformer "https://github.com/suryapranav2k5/intraday-trading-intelligence-platform/blob/main/exit_transformer.py"
click node_backend "https://github.com/suryapranav2k5/intraday-trading-intelligence-platform/blob/main/app.py"
click node_clientdata "https://github.com/suryapranav2k5/intraday-trading-intelligence-platform/blob/main/Web/src/hooks/useTradingData.ts"
click node_supervisionhook "https://github.com/suryapranav2k5/intraday-trading-intelligence-platform/blob/main/Web/src/hooks/useTradeSupervision.ts"
click node_dashboard "https://github.com/suryapranav2k5/intraday-trading-intelligence-platform/blob/main/Web/src/pages/Index.tsx"
click node_supervisionpanel "https://github.com/suryapranav2k5/intraday-trading-intelligence-platform/blob/main/Web/src/components/Phase2SupervisionPanel.tsx"
click node_training "https://github.com/suryapranav2k5/intraday-trading-intelligence-platform/blob/main/train_universal.py"
click node_exittraining "https://github.com/suryapranav2k5/intraday-trading-intelligence-platform/blob/main/exit_transformer.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_smartclient,node_symbolmap,node_datahub,node_harvester toneBlue
class node_features,node_entry,node_entryengine,node_exitmanager,node_transformer toneAmber
class node_cache,node_backend,node_broker toneMint
class node_clientdata,node_supervisionhook,node_dashboard,node_supervisionpanel toneRose
class node_training,node_exittraining,node_trader toneIndigo
```

## Components

### Market ingestion

- [SmartAPI client](https://github.com/suryapranav2k5/intraday-trading-intelligence-platform/blob/main/SmartApi/smartapi_client.py): `SmartApi/smartapi_client.py`
- [Symbol mapping](https://github.com/suryapranav2k5/intraday-trading-intelligence-platform/blob/main/SmartApi/symbol_utils.py): `SmartApi/symbol_utils.py`
- [Realtime data hub](https://github.com/suryapranav2k5/intraday-trading-intelligence-platform/blob/main/SmartApi/realtime_data_hub.py): `SmartApi/realtime_data_hub.py`
- [Orderflow harvester](https://github.com/suryapranav2k5/intraday-trading-intelligence-platform/blob/main/orderflow_harvester.py): `orderflow_harvester.py`

### Trading intelligence

- [Feature engineering](https://github.com/suryapranav2k5/intraday-trading-intelligence-platform/blob/main/feature_engineering.py): `feature_engineering.py`
- [Entry inference](https://github.com/suryapranav2k5/intraday-trading-intelligence-platform/blob/main/inference.py): `inference.py`
- [Entry ensemble](https://github.com/suryapranav2k5/intraday-trading-intelligence-platform/blob/main/entry_inference.py): `entry_inference.py`
- [Live exit manager](https://github.com/suryapranav2k5/intraday-trading-intelligence-platform/blob/main/live_exit_engine.py): `live_exit_engine.py`
- [Exit transformer](https://github.com/suryapranav2k5/intraday-trading-intelligence-platform/blob/main/exit_transformer.py): `exit_transformer.py`

### Live service

- [Candle cache](https://github.com/suryapranav2k5/intraday-trading-intelligence-platform/blob/main/app.py): `app.py`
- [Trading backend](https://github.com/suryapranav2k5/intraday-trading-intelligence-platform/blob/main/app.py): `app.py`

### Supervision dashboard

- [Trading data hook](https://github.com/suryapranav2k5/intraday-trading-intelligence-platform/blob/main/Web/src/hooks/useTradingData.ts): `Web/src/hooks/useTradingData.ts`
- [Supervision hook](https://github.com/suryapranav2k5/intraday-trading-intelligence-platform/blob/main/Web/src/hooks/useTradeSupervision.ts): `Web/src/hooks/useTradeSupervision.ts`
- [Trading dashboard](https://github.com/suryapranav2k5/intraday-trading-intelligence-platform/blob/main/Web/src/pages/Index.tsx): `Web/src/pages/Index.tsx`
- [Phase 2 panel](https://github.com/suryapranav2k5/intraday-trading-intelligence-platform/blob/main/Web/src/components/Phase2SupervisionPanel.tsx): `Web/src/components/Phase2SupervisionPanel.tsx`

### Model development

- [Entry model training](https://github.com/suryapranav2k5/intraday-trading-intelligence-platform/blob/main/train_universal.py): `train_universal.py`
- [Exit model training](https://github.com/suryapranav2k5/intraday-trading-intelligence-platform/blob/main/exit_transformer.py): `exit_transformer.py`

### Other components

- **Trading operator**
- **Angel One SmartAPI**

## Connections

- Trading operator → Trading dashboard: views telemetry
- Angel One SmartAPI → SmartAPI client: streams market data
- SmartAPI client → Realtime data hub: provides stream (evidence: `SmartApi/realtime_data_hub.py`)
- Symbol mapping → Realtime data hub: maps symbols (evidence: `SmartApi/realtime_data_hub.py`)
- Realtime data hub → Trading backend: supplies market data (evidence: `app.py`)
- Angel One SmartAPI → Orderflow harvester: provides depth feed
- Orderflow harvester → Angel One SmartAPI: subscribes to feed
- Trading backend → Candle cache: updates candles (evidence: `app.py`)
- Trading backend → Entry inference: runs inference (evidence: `app.py`)
- Entry inference → Feature engineering: computes features
- Entry inference → Live exit manager: provides trade context (evidence: `inference.py`)
- Live exit manager → Exit transformer: uses model (evidence: `live_exit_engine.py`)
- Trading backend → Live exit manager: requests exit decision (evidence: `app.py`)
- Trading backend → Trading dashboard: emits telemetry
- Trading dashboard → Trading data hook: reads trading state
- Trading dashboard → Phase 2 panel: renders supervision (evidence: `Web/src/pages/Index.tsx`)
- Phase 2 panel → Supervision hook: uses supervision state
- Entry ensemble → Feature engineering: consumes features
- Entry model training → Entry inference: trains entry models
- Exit model training → Exit transformer: trains exit model (evidence: `exit_transformer.py`)
