Quantcast
Channel: Market Calls
Viewing all articles
Browse latest Browse all 2070

How to Send Alerts from Amibroker to Telegram Channel using Telgram API

$
0
0

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)

Related Readings and Observations

  • Didi Index Long only Trading SystemDidi Index Long only Trading System Didi Index is a positional long only trading system constructed based on three exponential moving averages inspired from mql4 code Didi Index Indicator. Indicator developed by Brazilian […]
  • Medium Term Buy Bartronics : Target 315Medium Term Buy Bartronics : Target 315 Buy : Bartronics CMP : Rs 200 Target : Rs 315 Time : 5-6Months Recommended to our SMSgupshup Group ( Marketbits ) at Rs 202 Caution : This stock may go down upto Rs 178 in short term.So […]
  • [Orderflow Tutorial] Big Buyer or Big Seller at the Days Extreme?[Orderflow Tutorial] Big Buyer or Big Seller at the Days Extreme? "My Orderflow is showing Big Buyers at day low and your orderflow is showing Big Sellers at day low which one is true" these are the frequent questions we get in our slack trading […]
  • Sell in June and Go Away?Sell in June and Go Away? Two charts in Nifty make me to think "Sell in June and Go Away". The above charts is nifty june hourly future chart which recently turns to sell mode during the later hour of the friday […]
  • Natural gas technical outlook (02.08.2013)Natural gas technical outlook (02.08.2013) Now Natural gas is trading around 205 ($3.350) & as we can see on charts , its reaching to the 3rd possible bottom of current descending channel. At the same time there is a support of […]
  • OptionsORACLE – Stock Options Analysis ToolOptionsORACLE – Stock Options Analysis Tool OptionsOracle is a free tool for stock options strategy analysis. It is a powerful tool that allows testing of different options strategies using real-time options & stock-market […]

Viewing all articles
Browse latest Browse all 2070

Trending Articles