Push-уведомления приходят с большей задержкой - страница 8

 
Andrey777:

bot.SendMessage() везде дописал, а это куда добавить? 

#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(---);
  }
//+------------------------------------------------------------------+

с отправкой фото надо смотреть. Вечером посмотрю.

 
tyup:

с отправкой фото надо смотреть. Вечером посмотрю.

- добавил bot.sendMessage(------); там где нужно.

- добавил 

#include <Telegram.mqh>
CCustomBot bot;
string Token="574958800:AAF222222CuFoe75BsSIwK9bqqw7rrfagIk";

выше  int OnInit() но уведомление не присылает. В чем может быть проблема?

 
Andrey777:

- добавил bot.sendMessage(------); там где нужно.

- добавил 

выше  int OnInit() но уведомление не присылает. В чем может быть проблема?

в init

bot.Token(Token);

тоже добавили?

тестовый скрипт работает?

 
tyup:

в init

bot.Token(Token);

тоже добавили?

тестовый скрипт работает?

Тестовый скрипт работает, вот так получилось. 

//+------------------------------------------------------------------+
//| 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);
  }
//+------------------------------------------------------------------+
//=================================================================================================================
 
tyup:

в init

bot.Token(Token);

тоже добавили?

тестовый скрипт работает?

правильно?

Причина обращения: