Trade Notifier for LINE Discord Telegram MT4
- Utilities
-
Kazuma Uezono
MQL5 / MQL4 / Pine Script v6 developer and active trader.
Seller on the MQL5 Market (indicators for MT4/MT5).
Services:
- TradingView Pine Script to MT5/MT4 conversion (bar-by-bar matching, with tester report)
- MT4 to MT5 migration - Version: 1.4
- Activations: 5
This MetaTrader 4 version of Trade Notifier posts the activity of your MT4 account to a LINE chat, a Discord channel or a Telegram chat. You get a message when a trade is opened or closed (with the result in money and pips), when SL or TP is moved, when a pending order is placed, deleted, expired or filled, when the margin level falls below your level, when the floating loss grows past your level, and once a day with a summary. Discord and Telegram can also show a picture of the chart.
The EA only reads and reports. It does not place, modify or close any order, it does not choose trades and it gives no signals. No DLL is used. Each message is sent from your MT4 straight to your own LINE official account, Discord webhook or Telegram bot, never through a server run by us.
Made for: MT4 users who run EAs on a VPS or trade by hand and want a short message on the phone or in a team channel each time something happens on the account. LINE users can receive messages again through the LINE Messaging API after the end of LINE Notify (March 2025); the setup and the free quota are different, as explained below.
Features
- Send to LINE (Messaging API, text), Discord (webhook, text plus chart picture) and Telegram (bot, text plus chart picture). Switch each one on or off; several at the same time are fine.
- Choose the events: trade opened, pending order filled, trade closed with profit or loss (swap and commission included) and pips, SL / TP moved on a trade or a pending order, pending order placed / deleted / expired, margin level under a level (default 150%), floating loss over a share of the balance (default 10%), daily summary at the change of the server date (closed trades, wins and losses, net result, balance, equity).
- Bridge for your own programs: an indicator, EA or script on the same computer writes a small text file into the common data folder and Trade Notifier sends its text. Indicators cannot make web requests in MQL4, so this is the way to get their alerts to LINE, Discord or Telegram. The guide shows the file format and a ready MQL4 function.
- Filter by symbol (all, the chart symbol, or a list) and by magic number (all, manual trades with magic 0, or a list).
- Keeps the number of messages down: events that happen within 5 seconds (0-60, adjustable) arrive as one message. For LINE a monthly counter with your own cap (default 180) warns once at 90% and then stops LINE only; Discord and Telegram keep going.
- Messages that could not be sent wait in a saved queue and are sent when possible, also after MT4 is restarted. Nothing is sent twice on purpose.
- Test send button on the chart panel, with the result shown per destination.
- The panel shows for LINE, Discord and Telegram: OK with the HTTP code, not set, URL not allowed, waiting because of too many requests, or the error, plus the LINE count of the month, the number of waiting messages and the time of the last send.
- 11 languages for messages and panel (English, Japanese, Russian, German, French, Chinese, Korean, Turkish, Spanish, Portuguese, Italian), from the terminal language or set in the inputs.
- A CSV file records each event and each send. A dry run setting writes the requests to files and sends nothing (tokens hidden).
Main Inputs
- LINE: send (off by default), channel access token, send to (user ID or group ID), monthly limit (180 by default, 0 = none), people who receive (1 by default; LINE counts every receiver).
- Discord: send (off by default), webhook URL, attach chart picture (on by default).
- Telegram: send (off by default), bot token, chat ID, attach chart picture (on by default).
- Events: trade opened, trade closed, SL / TP changed, pending orders (all on), margin level below % (150, 0 = off), floating loss over % of balance (10, 0 = off), daily summary (on), messages from other programs (on).
- Filters: symbols (all / chart symbol / list), symbol list, magic numbers (all / manual only / list), magic number list.
- Sending: combine events within (5 s), give up after (24 hours, 1-168), request time-out (5000 ms), language, title of each message (empty = MT4 and the account number's last 4 digits).
- Panel: show, corner, X and Y offset, font size. Advanced: CSV log, dry run.
How It Works
- First you make a LINE official account with a channel access token, a Discord webhook or a Telegram bot. In MT4 open Tools > Options > Expert Advisors, tick Allow WebRequest for listed URL and add https://api.line.me (LINE), https://discord.com (Discord, or the host your webhook URL starts with; the panel names it) and https://api.telegram.org (Telegram). Press Test send to check. Every step is in the user guide.
- The EA compares the open orders with the last check and reads the account history, then reports the differences. All times are server times and are marked "(server)".
- When MT4 is closed, nothing can be sent. After the next start, closed trades and other changes since the last run are reported, up to 2 days back and without repeats. The first time the EA is attached, older history is not sent.
- A chart picture (Discord and Telegram; opened, filled and closed trades and the test send) is made only when a chart of that symbol is open in MT4. Without such a chart the text is sent alone. The picture shows the whole chart, this panel included.
- Failed sends (no connection, time-out, server error) are repeated after 10 s, 30 s, 60 s, 2 min, 5 min and then every 10 min until the give-up time (24 hours by default). On HTTP 429 the EA waits for the time the service asks for. Each destination keeps its order: while one keeps failing, its newer messages wait behind the old ones; the other destinations are not held up.
- LINE monthly limit: the EA counts LINE messages per receiver in each calendar month of server time. When your cap is reached, or LINE answers that your plan's monthly limit is used up, LINE pauses and Discord and Telegram continue. LINE comes back in the next month or when you change the monthly limit input; after LINE's own limit, a successful test send also brings it back. LINE messages from the pause are dropped, not sent later.
- One chart per account sends. Extra copies of the EA on other charts of the same account only show the panel.
- Messages from other programs: *.txt files in the common folder Terminal\Common\Files\TradeNotifier\queue\ are checked every 2 seconds, taken in name order and deleted once read. Optional first line: destinations (all, line, discord, telegram) and "shot" for a chart picture; the text follows from the second line. UTF-8 (with or without BOM), UTF-16 LE with BOM and ANSI files are accepted, up to 64 KB, text up to 3000 characters.
- Messages to Discord do not ping @everyone or roles.
Notes and Limits
- Tokens and the webhook URL stay readable as plain text: in the EA inputs, in saved .set files, in chart profiles and templates (.chr / .tpl), and MT4 writes all inputs of the EA to the Experts log each time it is loaded. Whoever has them can post to your LINE account, Discord channel or Telegram bot. Do not share these files or logs, hide the input window when you share your screen, and take care on a shared PC or VPS. Make a new token if one leaks.
- Unless you fill in the Title input, each message starts with "MT4" and only the last 4 digits of your account number, like [MT4 #…1234]. If others can read the channel or group, a Title of your own is recommended; it then replaces this heading.
- LINE sends text only. A LINE official account with the Messaging API, its channel access token and the user ID or group ID are needed. Messages use the monthly quota of your LINE plan, which LINE Notify did not have (free plan in Japan currently 200 messages a month; LINE sets and may change prices and conditions). A group counts once per member, so set "people who receive". The EA's counter is only an estimate; what LINE counts, including other messages from the same account, decides. Finding a group ID needs a webhook, which the EA does not offer; the easy setup is sending to your own user ID.
- MT4 must be running and online with the EA on a chart. Use a VPS for round-the-clock notices.
- Running the EA on the same account in two terminals (for example home PC and VPS) sends everything twice. The common folder used by other programs is shared by every terminal on the computer.
- MT4 only: a pending order that is filled within about 1 second after it was placed can be reported as a trade opened instead of a pending order filled. A trade that was opened and closed while MT4 was off is reported only as closed.
- After a hard stop of the terminal, Discord or Telegram can rarely get one message twice. LINE is protected by a retry key.
- The daily summary is sent at the change of the server date and counts trades closed that day within the filters (a partial close counts as one trade). If MT4 was off at that moment, the last day the EA saw is summarised at the next start.
- In the Strategy Tester nothing is sent; the messages are only written to a CSV file.
- Move the panel with the corner and X / Y inputs if it covers the One Click Trading panel (default Y = 100). If it is hard to see, turn off "Chart on foreground" in the chart properties.
- MT4 shows chart text, such as the EA's panel, with the Windows language setting (ANSI code page). If the selected language uses characters that this Windows setting does not support (for example Korean on Japanese or English Windows), only the panel switches to English automatically; messages sent to LINE, Discord and Telegram keep the selected language.
Compatibility and Support
- MetaTrader 4, any symbol, one chart per account. Internet access and WebRequest permission for the addresses above are needed. Discord and Telegram accounts cost nothing; LINE needs a LINE official account (free plan in Japan; LINE decides the plans in other countries).
- No DLL. Files only in MQL4\Files\TradeNotifier\ and in the common folder TradeNotifier\queue\.
- Help by MQL5 message within 3 business days for installation, settings (LINE, Discord, Telegram, WebRequest) and bugs. We cannot set up or run your LINE, Discord or Telegram accounts for you, and we give no trading advice or market opinions.
- LINE, Discord and Telegram are trademarks of their respective owners, who do not make, endorse or support this product.
Disclaimer
- This EA is a notification tool. It does not trade and gives no investment advice. Messages may arrive late, not at all or twice because of MT4, the network or the LINE, Discord and Telegram services, so do not use them as the only way to watch your account. You are responsible for any LINE plan fees. Try it on a demo account first.
