是否可以从EA访问手机上的推送通知?

Grzegorz Korycki
37665
Grzegorz Korycki  
我的问题就像标题中一样。除了买卖交易,我还希望能够通过EA在手机上发送信息。 (在选定的时间范围内通知用户不断变化的市场状况)在Metatrader 5中是否可能?我尝试使用Alert(),但是它不会发出“被推”的声音。
特林·达特
52726
特林·达特  
您需要使用: 发送通知(..)
梅尔达·希里(Mehrdad Shiri)
4963
梅尔达·希里(Mehrdad Shiri)  

你好我在下面写下并在所有指标中使用它。

uint counterBUY=0;
uint counterSELL=0;
double Ask,Bid;
string text,sAsk,sBid,sPeriod;
//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
input string s99="-----------------------------------------------";      // ----------- ALARM Settings -----------------
input uint Numberof_Alerts_Maximum_Iterations=2;
input bool On_Push = true;                        //allow to send push-messages
input bool On_Email = true;                       //allow to send e-mail messages
input bool On_Alert= true;                        //allow to put alert
input bool On_Play_Sound = true;                  //allow to put sound signal
input string NameFileSound="request.wav";          //name of the file with sound in "...\MetaTrader 5\Sounds"
input string  CommentSirName="your indicator name:";  //the first part of the allert comment
//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
//+------------------------------------------------------------------+
int OnCalculate(const int rates_total,const int prev_calculated,
                const datetime &Time[],
                const double   &Open[],
                const double   &High[],
                const double   &Low[],
                const double   &Close[],
                const long     &TickVolume[],
                const long     &Volume[],
                const int      &Spread[])
{

//----------------------------------------------------------------------//
   MqlDateTime tm;
   TimeToStruct(TimeCurrent(),tm);
   text=TimeToString(TimeCurrent(),TIME_DATE)+" "+string(tm.hour)+":"+string(tm.min);
   Ask=Close[0];
   Bid=Close[0]+Spread[0];
   sAsk=DoubleToString(Ask,_Digits);
   sBid=DoubleToString(Bid,_Digits);
   sPeriod=EnumToString(ChartPeriod());
   if(rates_total!=prev_calculated) {counterBUY=0;counterSELL=0;}
//----------------------------------------------------------------------//      

//----------------------------------------------------------------------------------------------------------//
//---------------------------------------------------------------- PlaySound Alert 发送通知 SendMail 
//+++
     {
      if(counterBUY<Numberof_Alerts_Maximum_Iterations)
        {
         if(Indicator_Signal[0]==1&&Indicator_Signal[1]!=1) {BUY_ALARM();counterBUY++;}
        }
      if(counterSELL<Numberof_Alerts_Maximum_Iterations)
        {
         if(Indicator_Signal[0]==-1&&Indicator_Signal[1]!=-1) {SELL_ALARM();counterSELL++;}
        }
     }
//----------------------------------------------------------------------------------------------------------//
//--- done
   return(rates_total);
}
//+------------------------------------------------------------------+
//----------------------------------------------------------------------------------------------------------//
//********************************************************************************************************************
void BUY_ALARM()
  {
   if(On_Alert) Alert("BUY # ",Symbol(),"\n Period=",sPeriod,"\n Ask=",sAsk,"\n Bid=",sBid,"\n currtime=",text);
   if(On_Play_Sound) PlaySound("matrixrevolution.wav");
   if(On_Email) SendMail("BUY #",Symbol()+" Period="+sPeriod+", Ask="+sAsk+", Bid="+sBid+", currtime="+text);
   if(On_Push) 发送通知("BUY #"+Symbol()+" Period="+sPeriod+", Ask="+sAsk+", Bid="+sBid+", currtime="+text);
  }
//+------------------------------------------------------------------+
void SELL_ALARM()
  {
   if(On_Alert) Alert("SELL # ",Symbol(),"\n Period=",sPeriod,"\n Ask=",sAsk,"\n Bid=",sBid,"\n currtime=",text);
   if(On_Play_Sound) PlaySound("matrixrevolution.wav");
   if(On_Email) SendMail("SELL #",Symbol()+" Period="+sPeriod+", Ask="+sAsk+", Bid="+sBid+", currtime="+text);
   if(On_Push) 发送通知("SELL #"+Symbol()+" Period="+sPeriod+", Ask="+sAsk+", Bid="+sBid+", currtime="+text);
  }
//********************************************************************************************************************
//----------------------------------------------------------------------------------------------------------//

//www.tbxfkj.com/en/code/1868/34272#!tab=code

Grzegorz Korycki
37665
Grzegorz Korycki  
感谢您的回复! TIMisthebest非常详细的答案。你是最好的:)(或者Tim是)
梅尔达·希里(Mehrdad Shiri)
4963
梅尔达·希里(Mehrdad Shiri)  
被协定人:
感谢您的回复! TIMisthebest非常详细的答案。你是最好的:)(或者Tim是)

别客气。

我在这里学mql5;感谢他们的帮助。