Ballast Telegram MT4
- Utilità
- Versione: 1.0
- Attivazioni: 5
Your trades, daily results and account alerts in your Telegram, and a few safe commands back: status, open trades, pause your EAs, close everything with a code. For manual trading and for any Expert Advisor, on any symbol.
No DLL, no outside server: the EA talks to your own Telegram bot directly. Setup takes about three minutes.
- Trade messages: opened (lot, price, stop-loss, take-profit, risk in money and % of the balance, magic number), partly closed and closed (result in money, pips and R, how long it was held, today's total, balance), stop-loss and take-profit changes ("Stop is at the entry (break-even)", "Stop is 12.0 pips past the entry"), and optionally pending orders. It waits 3 seconds after an entry, so a stop-loss and take-profit set right after it arrive in the same message.
- Correct money everywhere: risk and results are worked out from the symbol's tick value, so gold, indices and crypto show the right amounts, not only forex.
- Summaries: daily at the hour you choose and weekly on Friday: closed trades, how many won, result in money and %, best and worst trade, balance and equity. Counted by trade, so a trade closed in three parts counts once.
- Account alerts: equity down X% from the day start, margin level below your limit, broker connection lost and back, AutoTrading switched off and on.
- Commands from your chat: /status, /positions, /today, /help. /pause and /resume pause all your EAs through Ballast EA Pause. /closeall (off by default) closes all trades only after you send back a 4-digit code within 60 seconds.
- Only you: it answers your own chat id only; messages from anyone else are ignored. Commands sent while the EA was not running are skipped at start, not executed late.
- No lost and no double messages: if Telegram or the internet is down, messages wait in a queue and are sent in order when it is back. Each message is sent once.
- Filters: one magic number only, or manual trades only, and a list of symbols. An account name of your choice in every message, handy with several accounts.
- Easy setup: leave the chat id empty, send /start to your bot and it replies with your chat id. The panel on the chart shows what is missing (token, chat id, the WebRequest address) in plain words.
Setup
- In Telegram open @BotFather, send /newbot, pick a name. Copy the token it gives you.
- In MetaTrader: Tools > Options > Expert Advisors > Allow WebRequest for listed URL, add https://api.telegram.org.
- Put Ballast Telegram on any one chart and paste the token into "Bot token". Send /start to your bot: it replies with your chat id. Enter it as "Your chat id". Done.
Tested
- Commands against a local stand-in for the Telegram Bot API: 23 of 23 checks passed: owner-only answers, old commands skipped at start, every command, the /closeall refusal while it is off, a stranger ignored, the EA Pause alerts, the queue while "Telegram" was down, setup mode, a wrong token and a missing WebRequest address.
- Strategy Tester, EURUSD M15, one week of demo trades with partial closes and stop moves: all 59 close and partial-close messages match the report to the cent (MT4 gives the rest of a partly closed trade a new ticket; it is followed), all 29 whole-trade totals right.
Good to know
- The terminal has to be running (a VPS is fine): the EA sends from inside MetaTrader. While the terminal is off nothing is sent.
- One copy on one chart watches the whole account. Use one copy per account.
- Your bot token stays in the EA's inputs on your computer; it is sent to Telegram only.
- Commands are read every 2 seconds, so a reply comes in about 1 to 3 seconds.
- In the Strategy Tester WebRequest is not available: every message is written to the journal instead, with demo trades so you can see what you would get.
- /closeall needs AutoTrading on in the terminal and Allow live trading ticked for the EA (F7 > Common). If either is off, the bot says which one and closes nothing.
Works well with
- Ballast Account Alerts MT4 — push alerts for equity drops, low margin and trades without a stop
- Ballast Local Copier MT4 — copies trades between terminals on one PC or VPS
- Ballast Prop Guard MT4 — keeps a prop-firm challenge inside the daily and total loss limits
