Hi All,
I have the code below which is sending multiple telegram messages in 5 mins time frame.
Someone please update the code so it can send only 1 message per Candle BAR.
TelegramAlerts = ParamTrigger("Telegram Alert","Send Alert");
TelegramAPI_ID = ParamStr("Telegram Bot API Key","1046872120:wwwwwn_TVmddddGfUlmc"); //Get the Bot API key via BotFather in Telgram
TelgramCHAT_ID = ParamStr("Telegram Channel ID","4xxxxx5"); //Channel ID
Message = "Check this Stock "+Name();
TelegramAlerts1 = InternetOpenURL("https://api.telegram.org/bot"+TelegramAPI_ID+"/sendMessage?chat_id="+TelgramCHAT_ID+"&text= "+Message );
AlertIf((Buy), "EXEC TelegramAlerts1","Tele Alert", 3);
InternetClose(TelegramAlerts1);
Thanks a lot in advance
CL
rottor
December 20, 2019, 7:53pm
2
first you'll need to decide ... either you use AlertIf(EXEC ...), or InternetOpenURL()
lets consider we use only
AlertIf(EXEC
and still i face multiple msg on telegram
Hi Rottor,
I have managed to get proper Telegram messages with your HINT,.. I have a new problem .. it works properly in 1 min chart and i get 1 telegram message in 1 min. But when in 5 mins chart, I get 10 telegram messages till the bar is over. So need to minimize the number of telegram messages..PLEASE GUIDE...
HERE is the code
if( LastValue( Buy ) )
{
TelegramAlertsBuy = InternetOpenURL("https://api.telegram.org/bot"+TelegramAPI_ID+"/sendMessage?chat_id="+TelgramCHAT_ID+"&text= "+MessageBUY );
InternetClose(TelegramAlertsBUY);
}
if( LastValue( Sell ) )
{
Sell = ExRem (Sell,Buy);
TelegramAlertsSELL = InternetOpenURL("https://api.telegram.org/bot"+TelegramAPI_ID+"/sendMessage?chat_id="+TelgramCHAT_ID+"&text= "+MessageSELL );
InternetClose(TelegramAlertsSELL);
}
awilson
December 21, 2019, 12:22pm
6
Can you please give me the correct working code.. i couldnt get it RIGHT ... plz plz guide
@chaaranpall ,
See
Search the forum
It is good idea to search the forum before asking same questions over and over. To search the forum just use magnifying glass icon in the upper right corner
[image]
Also it is good idea to use Google and add +site:amibroker.com to your search term to limit the output to content of amibroker.com web site. Doing so will include results from Knowledge Base and Users' Guide
Enter the AFL code properly
It is of utmost importance as improperly formatted code results in syntax error…
A new custom badge for the forum has been introduced: License Verified.
See https://forum.amibroker.com/badges/102/license-verified
On users profile page it is visible like this:
[image]
Users that have such badge in their profile page are verified holders of AmiBroker license.
The badge is automatically granted if forum account uses same email address as email used for purchase. Approximately 44% of forum users have that badge granted automatically.
If you use different email for the foru…