# sholafalana/mt5-mt4-telegram-api-bot architecture

> Architecture diagram of the GitHub repository sholafalana/mt5-mt4-telegram-api-bot, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-28). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/sholafalana/mt5-mt4-telegram-api-bot
- Repository: https://github.com/sholafalana/mt5-mt4-telegram-api-bot

## Overview

This repository provides MT4/MT5 trading-terminal bots that send trade-event alerts to Telegram, with email and terminal notifications also documented. The README describes configuring a Telegram bot and channel/group, then copying the Include files and entering the API key in an Expert Advisor. The tree contains one MT4 source EA, shared include files, and compiled MT4/MT5 products. No source excerpts are available, so internal calls and the exact roles of the compiled files cannot be verified; edges below reflect README statements only.

Main entry points: [`Experts/TelegramAlert_MT4.mq4`](https://github.com/sholafalana/mt5-mt4-telegram-api-bot/blob/master/Experts/TelegramAlert_MT4.mq4) (MT4 alert EA), [`MQL5/Trading Chat Bot Telegram.ex5`](https://github.com/sholafalana/mt5-mt4-telegram-api-bot/blob/master/MQL5/Trading%20Chat%20Bot%20Telegram.ex5) (MT5 trading bot)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_mt4["MT4 experts"]
  node_mt4_alert_ea["MT4 alert EA"]
  node_mt4_chatbot["MT4 trading bot"]
end

subgraph group_shared["Shared includes"]
  node_comment["Comment helpers<br/>[Comment.mqh]"]
  node_common["Common helpers<br/>[Common.mqh]"]
  node_telegram_lib["Telegram API<br/>[Telegram.mqh]"]
  node_json["JSON parser<br/>[jason.mqh]"]
end

subgraph group_mt5["MT5 products"]
  node_mt5_screenshots["MT5 screenshot alerts"]
  node_mt5_chatbot["MT5 trading bot"]
end

subgraph group_destinations["Alert destinations"]
  node_email(("Email"))
  node_terminal_notifications(("Terminal notifications"))
  node_telegram_channel(("Telegram group or channel"))
end

node_mt4_terminal(("MT4 terminal"))
node_mt5_terminal(("MT5 terminal"))
node_telegram(("Telegram bot"))

node_mt4_terminal -->|"trade events"| node_mt4_alert_ea
node_mt4_alert_ea -->|"sends alerts"| node_telegram_channel
node_mt4_alert_ea -->|"sends alerts"| node_email
node_mt4_alert_ea -->|"sends alerts"| node_terminal_notifications
node_mt5_terminal -->|"trade events"| node_mt5_chatbot
node_mt5_chatbot -->|"sends alerts"| node_telegram_channel
node_mt5_chatbot -->|"sends alerts"| node_email
node_mt5_chatbot -->|"sends alerts"| node_terminal_notifications

click node_mt4_alert_ea "https://github.com/sholafalana/mt5-mt4-telegram-api-bot/blob/master/Experts/TelegramAlert_MT4.mq4"
click node_mt4_chatbot "https://github.com/sholafalana/mt5-mt4-telegram-api-bot/blob/master/Experts/Telegram%20Chat%20Bot%20for%20Trading.ex4"
click node_comment "https://github.com/sholafalana/mt5-mt4-telegram-api-bot/blob/master/Include/Comment.mqh"
click node_common "https://github.com/sholafalana/mt5-mt4-telegram-api-bot/blob/master/Include/Common.mqh"
click node_telegram_lib "https://github.com/sholafalana/mt5-mt4-telegram-api-bot/blob/master/Include/Telegram.mqh"
click node_json "https://github.com/sholafalana/mt5-mt4-telegram-api-bot/blob/master/Include/jason.mqh"
click node_mt5_screenshots "https://github.com/sholafalana/mt5-mt4-telegram-api-bot/blob/master/MQL5/Telegram-Alert-ScrreenShots%20V3.0.ex5"
click node_mt5_chatbot "https://github.com/sholafalana/mt5-mt4-telegram-api-bot/blob/master/MQL5/Trading%20Chat%20Bot%20Telegram.ex5"

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_mt4_alert_ea,node_mt4_chatbot toneBlue
class node_comment,node_common,node_telegram_lib,node_json toneAmber
class node_mt5_screenshots,node_mt5_chatbot toneMint
class node_email,node_terminal_notifications,node_telegram_channel toneRose
class node_mt4_terminal,node_mt5_terminal,node_telegram toneIndigo
```

## Components

### MT4 experts

- [MT4 alert EA](https://github.com/sholafalana/mt5-mt4-telegram-api-bot/blob/master/Experts/TelegramAlert_MT4.mq4): `Experts/TelegramAlert_MT4.mq4`
- [MT4 trading bot](https://github.com/sholafalana/mt5-mt4-telegram-api-bot/blob/master/Experts/Telegram%20Chat%20Bot%20for%20Trading.ex4): `Experts/Telegram Chat Bot for Trading.ex4`

### Shared includes

- [Comment helpers](https://github.com/sholafalana/mt5-mt4-telegram-api-bot/blob/master/Include/Comment.mqh): `Include/Comment.mqh`
- [Common helpers](https://github.com/sholafalana/mt5-mt4-telegram-api-bot/blob/master/Include/Common.mqh): `Include/Common.mqh`
- [Telegram API](https://github.com/sholafalana/mt5-mt4-telegram-api-bot/blob/master/Include/Telegram.mqh): `Include/Telegram.mqh`
- [JSON parser](https://github.com/sholafalana/mt5-mt4-telegram-api-bot/blob/master/Include/jason.mqh): `Include/jason.mqh`

### MT5 products

- [MT5 screenshot alerts](https://github.com/sholafalana/mt5-mt4-telegram-api-bot/blob/master/MQL5/Telegram-Alert-ScrreenShots%20V3.0.ex5): `MQL5/Telegram-Alert-ScrreenShots V3.0.ex5`
- [MT5 trading bot](https://github.com/sholafalana/mt5-mt4-telegram-api-bot/blob/master/MQL5/Trading%20Chat%20Bot%20Telegram.ex5): `MQL5/Trading Chat Bot Telegram.ex5`

### Alert destinations

- **Email**
- **Terminal notifications**
- **Telegram group or channel**

### Other components

- **MT4 terminal**
- **MT5 terminal**
- **Telegram bot**

## Connections

- MT4 terminal → MT4 alert EA: trade events (evidence: `README.md`)
- MT4 alert EA → Telegram group or channel: sends alerts (evidence: `README.md`)
- MT4 alert EA → Email: sends alerts (evidence: `README.md`)
- MT4 alert EA → Terminal notifications: sends alerts (evidence: `README.md`)
- MT5 terminal → MT5 trading bot: trade events (evidence: `README.md`)
- MT5 trading bot → Telegram group or channel: sends alerts (evidence: `README.md`)
- MT5 trading bot → Email: sends alerts (evidence: `README.md`)
- MT5 trading bot → Terminal notifications: sends alerts (evidence: `README.md`)
