# kefotrade26-maker/k3fotra4e architecture

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

- Interactive diagram: https://gitdiagram.com/kefotrade26-maker/k3fotra4e
- Repository: https://github.com/kefotrade26-maker/k3fotra4e

## Overview

KoveerBridge bridges Pocket Option market data into MT4 history files and local monitoring/chart services. The main workflow extracts demo credentials, connects and loads history, hands live updates to a multi-asset runner, and writes candle history for MT4 and the chart API. The README documents additional dashboard, chart-recovery, and diagnostics capabilities. Edges are limited to relationships shown in excerpts or the README; unsampled internals are not inferred.

Main entry points: [`multi_runner_2.py`](https://github.com/kefotrade26-maker/k3fotra4e/blob/main/multi_runner_2.py) (Multi-asset engine), [`dashboard_server_2.py`](https://github.com/kefotrade26-maker/k3fotra4e/blob/main/dashboard_server_2.py) (Dashboard API), [`chart_api.py`](https://github.com/kefotrade26-maker/k3fotra4e/blob/main/chart_api.py) (Chart data API), [`po_client.py`](https://github.com/kefotrade26-maker/k3fotra4e/blob/main/po_client.py) (WebSocket client)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_ingest["Authentication and feed"]
  node_auth["HAR authentication<br/>[po_auth.py]"]
  node_client["WebSocket client<br/>[po_client.py]"]
end

subgraph group_engine["Bridge and MT4"]
  node_runner["Multi-asset engine<br/>[multi_runner_2.py]"]
  node_writer["MT4 history writers<br/>[main_runner.py]"]
  node_asset_control["Active asset controls<br/>[active_assets.txt]"]
  node_mt4_history[("CSV and HST history")]
end

subgraph group_ui["Dashboard and charts"]
  node_dashboard_server["Dashboard API"]
  node_dashboard_ui["Dashboard UI<br/>[dashboard_2.html]"]
  node_chart_host["Chart service host"]
  node_chart_api["Chart data API<br/>[chart_api.py]"]
  node_chart_view["Candlestick chart<br/>[chart.html]"]
  node_assets_catalog["Asset catalogue<br/>[po_assets.json]"]
end

subgraph group_operations["Monitoring and legacy"]
  node_diagnostics["Diagnostics utility<br/>[diagnose.py]"]
  node_legacy_runner["Single-asset runner<br/>[multi_runner.py]"]
  node_mt4_indicator["KOVEER SMC indicator"]
end

node_user(("Local operator"))
node_pocket_option{{"Pocket Option"}}

node_user -->|"exports HAR"| node_auth
node_auth -->|"provides credentials"| node_runner
node_runner -->|"requests history and streams"| node_client
node_client -->|"connects and authenticates"| node_pocket_option
node_runner -->|"reads active assets"| node_asset_control
node_runner -->|"writes candles through"| node_writer
node_writer -->|"writes CSV and HST"| node_mt4_history
node_user -->|"controls assets"| node_dashboard_ui
node_dashboard_ui -.->|"uses dashboard service"| node_dashboard_server
node_dashboard_server -->|"updates controls"| node_asset_control
node_dashboard_server -->|"serves catalogue"| node_assets_catalog
node_dashboard_server -->|"reads telemetry"| node_runner
node_chart_host -->|"registers app"| node_dashboard_server
node_chart_host -->|"registers routes"| node_chart_api
node_chart_api -->|"reads CSV candles"| node_mt4_history
node_chart_api -.->|"recovers history"| node_client
node_chart_view -.->|"requests chart data"| node_chart_api
node_diagnostics -->|"reads telemetry and logs"| node_runner

click node_auth "https://github.com/kefotrade26-maker/k3fotra4e/blob/main/po_auth.py"
click node_client "https://github.com/kefotrade26-maker/k3fotra4e/blob/main/po_client.py"
click node_runner "https://github.com/kefotrade26-maker/k3fotra4e/blob/main/multi_runner_2.py"
click node_writer "https://github.com/kefotrade26-maker/k3fotra4e/blob/main/main_runner.py"
click node_asset_control "https://github.com/kefotrade26-maker/k3fotra4e/blob/main/Files/active_assets.txt"
click node_dashboard_server "https://github.com/kefotrade26-maker/k3fotra4e/blob/main/dashboard_server_2.py"
click node_dashboard_ui "https://github.com/kefotrade26-maker/k3fotra4e/blob/main/dashboard_2.html"
click node_chart_host "https://github.com/kefotrade26-maker/k3fotra4e/blob/main/dashboard_with_chart.py"
click node_chart_api "https://github.com/kefotrade26-maker/k3fotra4e/blob/main/chart_api.py"
click node_chart_view "https://github.com/kefotrade26-maker/k3fotra4e/blob/main/chart.html"
click node_assets_catalog "https://github.com/kefotrade26-maker/k3fotra4e/blob/main/po_assets.json"
click node_diagnostics "https://github.com/kefotrade26-maker/k3fotra4e/blob/main/diagnose.py"
click node_legacy_runner "https://github.com/kefotrade26-maker/k3fotra4e/blob/main/multi_runner.py"
click node_mt4_indicator "https://github.com/kefotrade26-maker/k3fotra4e/blob/main/Indicators/KOVEER%2014%20PM%20-%20HTF%20-%20SMC.mq4"

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_auth,node_client toneBlue
class node_runner,node_writer,node_asset_control,node_mt4_history toneAmber
class node_dashboard_server,node_dashboard_ui,node_chart_host,node_chart_api,node_chart_view,node_assets_catalog toneMint
class node_diagnostics,node_legacy_runner,node_mt4_indicator toneRose
class node_user,node_pocket_option toneIndigo
```

## Components

### Authentication and feed

- [HAR authentication](https://github.com/kefotrade26-maker/k3fotra4e/blob/main/po_auth.py): `po_auth.py`
- [WebSocket client](https://github.com/kefotrade26-maker/k3fotra4e/blob/main/po_client.py): `po_client.py`

### Bridge and MT4

- [Multi-asset engine](https://github.com/kefotrade26-maker/k3fotra4e/blob/main/multi_runner_2.py): `multi_runner_2.py`
- [MT4 history writers](https://github.com/kefotrade26-maker/k3fotra4e/blob/main/main_runner.py): `main_runner.py`
- [Active asset controls](https://github.com/kefotrade26-maker/k3fotra4e/blob/main/Files/active_assets.txt): `Files/active_assets.txt`
- **CSV and HST history**

### Dashboard and charts

- [Dashboard API](https://github.com/kefotrade26-maker/k3fotra4e/blob/main/dashboard_server_2.py): `dashboard_server_2.py`
- [Dashboard UI](https://github.com/kefotrade26-maker/k3fotra4e/blob/main/dashboard_2.html): `dashboard_2.html`
- [Chart service host](https://github.com/kefotrade26-maker/k3fotra4e/blob/main/dashboard_with_chart.py): `dashboard_with_chart.py`
- [Chart data API](https://github.com/kefotrade26-maker/k3fotra4e/blob/main/chart_api.py): `chart_api.py`
- [Candlestick chart](https://github.com/kefotrade26-maker/k3fotra4e/blob/main/chart.html): `chart.html`
- [Asset catalogue](https://github.com/kefotrade26-maker/k3fotra4e/blob/main/po_assets.json): `po_assets.json`

### Monitoring and legacy

- [Diagnostics utility](https://github.com/kefotrade26-maker/k3fotra4e/blob/main/diagnose.py): `diagnose.py`
- [Single-asset runner](https://github.com/kefotrade26-maker/k3fotra4e/blob/main/multi_runner.py): `multi_runner.py`
- [KOVEER SMC indicator](https://github.com/kefotrade26-maker/k3fotra4e/blob/main/Indicators/KOVEER%2014%20PM%20-%20HTF%20-%20SMC.mq4): `Indicators/KOVEER 14 PM - HTF - SMC.mq4`

### Other components

- **Local operator**
- **Pocket Option**

## Connections

- Local operator → HAR authentication: exports HAR (evidence: `README.md`)
- HAR authentication → Multi-asset engine: provides credentials (evidence: `README.md`)
- Multi-asset engine → WebSocket client: requests history and streams (evidence: `README.md`)
- WebSocket client → Pocket Option: connects and authenticates (evidence: `README.md`)
- Multi-asset engine → Active asset controls: reads active assets (evidence: `README.md`)
- Multi-asset engine → MT4 history writers: writes candles through (evidence: `multi_runner_2.py`)
- MT4 history writers → CSV and HST history: writes CSV and HST (evidence: `README.md`)
- Local operator → Dashboard UI: controls assets (evidence: `README.md`)
- Dashboard UI → Dashboard API: uses dashboard service (evidence: `README.md`)
- Dashboard API → Active asset controls: updates controls (evidence: `README.md`)
- Dashboard API → Asset catalogue: serves catalogue (evidence: `README.md`)
- Dashboard API → Multi-asset engine: reads telemetry (evidence: `README.md`)
- Chart service host → Dashboard API: registers app (evidence: `dashboard_with_chart.py`)
- Chart service host → Chart data API: registers routes (evidence: `dashboard_with_chart.py`)
- Chart data API → CSV and HST history: reads CSV candles (evidence: `README.md`)
- Chart data API → WebSocket client: recovers history (evidence: `chart_api.py`)
- Candlestick chart → Chart data API: requests chart data (evidence: `README.md`)
- Diagnostics utility → Multi-asset engine: reads telemetry and logs (evidence: `diagnose.py`)
