Push notifications come with a longer delay - page 8 12345678 New comment tyup 2019.03.16 02:28 #71 Andrey777: bot.SendMessage() has been added everywhere, but where should I add this? #include <Telegram.mqh> CCustomBot bot; string Token="574958800:AAF222222CuFoe75BsSIwK9bqqw7rrfagIk"; int OnInit() { //--- bot.Token(token); //--- return(INIT_SUCCEEDED); } //+------------------------------------------------------------------+ //| Expert deinitialization function | //+------------------------------------------------------------------+ void OnDeinit(const int reason) { //--- } //+------------------------------------------------------------------+ //| Expert tick function | //+------------------------------------------------------------------+ void OnTick() { //--- bot.sendMessage(------); bot.sendPhoto(---); } //+------------------------------------------------------------------+ I have to look at sending a photo. I'll look at it tonight. Andrey777 2019.03.18 19:57 #72 tyup: with sending a photo, you'll have to look at it. I'll look at it tonight.- addedbot.sendMessage(------); where needed. - added #include <Telegram.mqh> CCustomBot bot; string Token="574958800:AAF222222CuFoe75BsSIwK9bqqw7rrfagIk"; above int OnInit() but it doesn't send notification. What can be the problem? tyup 2019.03.19 05:58 #73 Andrey777: - addedbot.sendMessage(------); where needed. - added int OnInit() above, but it doesn't send a notification. What might be the problem?In init bot.Token(Token); also added? Is the test script working? Andrey777 2019.03.19 09:21 #74 tyup: in init bot.Token(Token); also added? Does the test script work?The test script works, that's how it turned out. //+------------------------------------------------------------------+ //| Custom indicator initialization function | //+------------------------------------------------------------------+ #include <Telegram.mqh> string Token="744665737:AAH5MhCME439HGQyFIbe2cqq1U1-R1804tU"; CCustomBot bot; int OnInit() { bot.Token(Token); SetIndexBuffer(0,DotUpbuf1); SetIndexStyle(0, DRAW_ARROW); SetIndexArrow(0, 108); SetIndexBuffer(1, Upbuf1); SetIndexStyle(1, DRAW_ARROW, EMPTY, WidthArr2); SetIndexArrow(1, 233); SetIndexBuffer(2,DotDnbuf1); SetIndexStyle(2, DRAW_ARROW); SetIndexArrow(2, 108); SetIndexBuffer(3, Dnbuf1); SetIndexStyle(3, DRAW_ARROW, EMPTY, WidthArr2); SetIndexArrow(3, 234); SetIndexBuffer(4,DotUpbuf2); SetIndexStyle(4, DRAW_ARROW); SetIndexArrow(4, 108); SetIndexBuffer(5, Upbuf2); SetIndexStyle(5, DRAW_ARROW, EMPTY, WidthArr2); SetIndexArrow(5, 233); SetIndexBuffer(6,DotDnbuf2); SetIndexStyle(6, DRAW_ARROW); SetIndexArrow(6, 108); SetIndexBuffer(7, Dnbuf2); SetIndexStyle(7, DRAW_ARROW, EMPTY, WidthArr2); SetIndexArrow(7, 234); SetIndexBuffer(8, Upbuf1_1); SetIndexStyle(8, DRAW_ARROW, EMPTY, WidthArr1); SetIndexArrow(8, 233); SetIndexBuffer(9, Dnbuf1_1); SetIndexStyle(9, DRAW_ARROW, EMPTY, WidthArr1); SetIndexArrow(9, 234); SetIndexBuffer(10, Upbuf2_1); SetIndexStyle(10, DRAW_ARROW, EMPTY, WidthArr1); SetIndexArrow(10, 233); SetIndexBuffer(11, Dnbuf2_1); SetIndexStyle(11, DRAW_ARROW, EMPTY, WidthArr1); SetIndexArrow(11, 234); ClearObjects(); ClearObjectsOfFilter(); return(INIT_SUCCEEDED); } //+------------------------------------------------------------------+ //| Custom indicator deinitialization function | //+------------------------------------------------------------------+ //--------------------------------------------------------------------------------------------------------- datetime headT = iTime(Symbol(), Timeframe, 0); if (Period() > Timeframe) headT = Time[0]; if(Signal && iBarShift(Symbol(), 0, timeSignal) > CT(1)) { if (Upbuf1[CT(1)]<EMPTY_VALUE || (UseTime2&&Upbuf2[CT(1)]<EMPTY_VALUE)) { Alert("Signal BUY - "+Symbol()); SendNotification("Signal BUY - "+Symbol()); bot.SendMessage(337777772,"Signal BUY - "+Symbol()); ChartBringToTop(); timeSignal = iTime(Symbol(), 0, CT(1)); } if (Dnbuf1[CT(1)]<EMPTY_VALUE || (UseTime2&&Dnbuf2[CT(1)]<EMPTY_VALUE)) { Alert("Signal SELL - "+Symbol()); SendNotification("Signal SELL - "+Symbol()); bot.SendMessage(337777772,"Signal SELL - "+Symbol()); ChartBringToTop(); timeSignal = iTime(Symbol(), 0, CT(1)); } } //--- return value of prev_calculated for next call return(rates_total); } //+------------------------------------------------------------------+ //================================================================================================================= Andrey777 2019.03.20 13:56 #75 tyup: in init bot.Token(Token); also added? Is the test script working?right? 12345678 New comment
bot.SendMessage() has been added everywhere, but where should I add this?
I have to look at sending a photo. I'll look at it tonight.
with sending a photo, you'll have to look at it. I'll look at it tonight.
- addedbot.sendMessage(------); where needed.
- added
above int OnInit() but it doesn't send notification. What can be the problem?
- addedbot.sendMessage(------); where needed.
- added
int OnInit() above, but it doesn't send a notification. What might be the problem?
In init
bot.Token(Token);
also added?
Is the test script working?
in init
bot.Token(Token);
also added?
Does the test script work?
The test script works, that's how it turned out.
in init
bot.Token(Token);
also added?
Is the test script working?
right?