Metatrader to Telegram Ultimate

# Telegram Signal Forwarder EA for MetaTrader 5

## Overview

This Expert Advisor automatically forwards all trading activity to a Telegram channel or group. It tracks **positions AND pending orders** in real-time and sends formatted signals.

**Key Feature:** All follow-up messages (close, partial close, modify, delete) are sent as **replies to the original signal** in Telegram, creating a clean threaded conversation for each trade.

## Signal Types

### For Positions (Market Orders)
- **OPEN BUY/SELL** - New position opened
- **CLOSE BUY/SELL** - Position fully closed (with P/L, pips)
- **PARTIAL CLOSE** - Position partially closed (with %)
- **TP MODIFIED** - Take Profit changed
- **SL MODIFIED** - Stop Loss changed

### For Pending Orders
- **OPEN BUY/SELL LIMIT** - Limit order placed
- **OPEN BUY/SELL STOP** - Stop order placed
- **DELETE** - Pending order cancelled
- **TRIGGERED** - Pending order executed
- **PRICE MODIFIED** - Entry price changed
- **TP/SL MODIFIED** - Levels changed

## Key Features

### Reply Threading
Every update to a trade is sent as a **reply** to the original OPEN message in Telegram:
- Close signals reply to the open signal
- Partial closes reply to the open signal
- All modifications reply to the open signal
- Delete signals reply to the open signal

This keeps all information about a single trade grouped together!

### Persistence Across Restarts
The EA saves its state including **Telegram message IDs** to a CSV file. This means:
- After restart, replies still work correctly
- No duplicate signals for existing trades
- Trades closed while offline are detected

---

## Installation

### Step 1: Create Telegram Bot

1. Open Telegram and search for `@BotFather`
2. Send `/newbot` and follow the prompts
3. Copy the **Bot Token** (looks like: `123456789:ABCdefGHIjklMNOpqrsTUVwxyz`)
4. Save this token for EA configuration

### Step 2: Get Chat ID

**For a Channel:**
1. Create your channel or use existing one
2. Make the channel **public** temporarily (e.g., `@MySignalsChannel`)
3. Add your bot as **administrator** with "Post Messages" permission
4. Send any message to the channel
5. Visit: `https://api.telegram.org/bot<YOUR_TOKEN>/getUpdates`
6. Find `"chat":{"id":-100XXXXXXXXXX}` - this is your Chat ID
7. You can make the channel private again after getting the ID

**For a Group:**
1. Add the bot to your group
2. Send a message in the group
3. Visit: `https://api.telegram.org/bot<YOUR_TOKEN>/getUpdates`
4. Find the chat ID (negative number for groups)

**For Direct Messages:**
1. Start a chat with your bot
2. Send any message
3. Visit the getUpdates URL above
4. Find your personal chat ID (positive number)

### Step 3: Enable WebRequest in MT5

1. Go to **Tools → Options → Expert Advisors**
2. Check **"Allow WebRequest for listed URL"**
3. Click **Add** and enter: `https://api.telegram.org`
4. Click **OK**

Altri dall’autore
You know the issue if you accidentally open too big lotsize? This ea will help you by immediatly closing the trade. There is a filter, for Symbols which should be ignored. Fill in max allowed lotsize. Whenever a lotsize is bigger than that and is not wanted to be ignored, it will be closed instantly. If you let it run on your vps and youre going to trade with you mobile, and forgot to adjust Lotsize before the trade, this EA will limit you loss by closing fast.
This script is made for CSV Export of your trading history. 1. Filter your trade history for the desired time range 2. Drag and Drop the script on a chart. 3. Go to your files folder within the MQL4 folder. 4. Find the CSV. You can use CSV files for most database software, like Access, Sql or Excel. After importing data you can do analysis on it or starting tradingjournal or whatever you like :) Please keep in mind we deleted the decimal, cause depending on your area the decimal sign is a "."
Filtro:
Nessuna recensione
Rispondi alla recensione