In this tutorial we will be discussing practical examples of how to send alerts from Amibroker to a Telegram channel using Telegram Bot API
In order to be able to do so, you will have first to:
- Create a Telegram public channel
- Create a Telegram BOT via BotFather
- Set the bot as administrator in your channel
Getting the BOT API key from BotFather in Telgram APP

Provided that you did the above, now you can send a message to your channel by issuing an HTTP GET request to the Telegram BOT API at the following URL:
https://api.telegram.org/bot[BOT_API_KEY]/sendMessage?chat_id=[MY_CHANNEL_NAME]&text=[MY_MESSAGE_TEXT]where:
- BOT_API_KEY is the API Key generated by BotFather when you created your bot
- MY_CHANNEL_NAME is the handle of your channel (e.g. @my_channel_name)
- MY_MESSAGE_TEXT is the message you want to send (URL-encoded)
One can send Telgram Alerts from Amibroker in two different ways
1)Modern Way to access HTTP API using InternetOpenURL functions (Supports Amibroker 6.17 or higher)
2)Using AFL scripting (VBScript) inside the AFL Program (legacy method compatible with most of the versions of Amibroker)
Legacy Method
Using AFL scripting (VBScript)
If you understand Amibroker from a coding perspective it supports AFL scripting host. AFL scripting host is an interface between AFL engine and JScript/VBScript engines (aka. Active Scripting technologies) available as a part of Internet Tools & Technologies platform provided by Microsoft.
Modern Method
using InternetOpenURL functions
Code requires Amibroker 6.17 as some of the new AFL functions like InternetClose( handle ) , InternetOpenURL( “url” ) , InternetReadString( handle ) – which is essecial to read from internet resource/http api is available from v6.17 or higher version.
Amibroker Controls
1)Apply the AFL to the chart and over the chart -> right click and select Properties
2)Enter the Telegram Bot API Key and Channel ID as per your requirement
3) Press the Send Alert (Trigger Button)

4)Bingo you are done. You should be able to see the Telegram Alert from Amibroker in your Telegram Channel

Hope you enjoyed this article!
If you are interested in getting Amibroker Installation Setup and Datafeeds (NSE Cash, NSE Futures, MCX Futures, NSE Currencies) setup you can fill up the 3 days Demo form here
www.marketcalls.in/demo
For any inquiries can reach our support team at 9535133445 /8861522875 ( 9a.m – 6p.m IST Mon – Sat)