Skip to content

Instantly share code, notes, and snippets.

@marketcalls
Created June 11, 2019 19:51
Show Gist options
  • Select an option

  • Save marketcalls/f42f1d0a684eee96a89a134bad1ef3d0 to your computer and use it in GitHub Desktop.

Select an option

Save marketcalls/f42f1d0a684eee96a89a134bad1ef3d0 to your computer and use it in GitHub Desktop.

Revisions

  1. marketcalls created this gist Jun 11, 2019.
    32 changes: 32 additions & 0 deletions Telegram Alerts - Modern Method.afl
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,32 @@
    //Coded by Rajandran R
    //Founder - Marketcalls - https://www.marketcalls.in
    //CoFounder - Traderscafe - http://traderscafe.in
    //Coded on 12th June 2019
    /*

    Note : Before Using this Code make sure you had followed the below mentioned steps

    1)Create a Telegram public channel
    2)Create a Telegram BOT via BotFather
    3)Set the bot as administrator in your channel

    */


    _SECTION_BEGIN("Telegram Alerts - Modern Method");

    Version(6.17); //Code is Compatible with 6.17 and Higher

    TelegramAlerts = ParamTrigger("Telegram Alert","Send Alert");
    TelegramAPI_ID = ParamStr("Telegram Bot API Key","854431837:AAEeSAtL_rgRZAMfxgxxxxxxxxxx"); //Get the Bot API key via BotFather in Telgram
    TelgramCHAT_ID = ParamStr("Telegram Channel ID","@marketcalls_in"); //Channel ID example : @marketcalls_in

    Message = "This is a Test Message from Amibroker";

    if (TelegramAlerts)
    {
    ih = InternetOpenURL("https://api.telegram.org/bot"+TelegramAPI_ID+"/sendMessage?chat_id="+TelgramCHAT_ID+"&text="+Message );
    InternetClose(ih);
    }

    _SECTION_END();