How can I stop SendingNotification Every Tick?

Back to topics list To post a new topic, please log in or register
avatar
1
heisenbergus 2016.01.28 14:43
 

sorry for bad english

I want to take notification 1 time.

 

int start()
  {
    
  
if((Hour()>=0)&&(Hour()<=23))
{int TradeTimeOk=1;}
else
{TradeTimeOk=0;}




double RSI_M15=iRSI(NULL,PERIOD_M15,14,0,0);
double RSI_M30=iRSI(NULL,PERIOD_M30,14,0,0);
double RSI_H1=iRSI(NULL,PERIOD_H1,14,0,0);
double RSI_H4=iRSI(NULL,PERIOD_H4,14,0,0);
double RSI_D1=iRSI(NULL,PERIOD_D1,14,0,0);




//////////////////////////////////////////////////+++++M15+++++
if((RSI_M15>=30)&&(RSI_M15<=33)&&(TradeTimeOk==1))
{
SendNotification("M15 RSI 30 Seviyesinde");
}
if((RSI_M15>=47)&&(RSI_M15<=50)&&(TradeTimeOk==1))
{
SendNotification("M15 RSI 50 Seviyesinde");
}
if((RSI_M15>=50)&&(RSI_M15<=53)&&(TradeTimeOk==1))
{
SendNotification("M15 RSI 50 Seviyesinde");
}
if((RSI_M15>=67)&&(RSI_M15<=70)&&(TradeTimeOk==1))
{
SendNotification("M15 RSI 70 Seviyesinde");
}
//////////////////////////////////////////////////+++++M15+++++




//////////////////////////////////////////////////+++++M30+++++

if((RSI_M30>=30)&&(RSI_M30<=33)&&(TradeTimeOk==1))
{
SendNotification("M30 RSI 30 Seviyesinde");
}
if((RSI_M30>=47)&&(RSI_M30<=50)&&(TradeTimeOk==1))
{
SendNotification("M30 RSI 50 Seviyesinde");
}
if((RSI_M30>=50)&&(RSI_M30<=53)&&(TradeTimeOk==1))
{
SendNotification("M30 RSI 50 Seviyesinde");
}
if((RSI_M30>=67)&&(RSI_M30<=70)&&(TradeTimeOk==1))
{
SendNotification("M30 RSI 70 Seviyesinde");
}
//////////////////////////////////////////////////+++++M30+++++




//////////////////////////////////////////////////+++++H1+++++
if((RSI_H1>=30)&&(RSI_H1<=33)&&(TradeTimeOk==1))
{
SendNotification("H1 RSI 30 Seviyesinde");
}
if((RSI_H1>=47)&&(RSI_H1<=50)&&(TradeTimeOk==1))
{
SendNotification("H1 RSI 50 Seviyesinde");
}
if((RSI_H1>=50)&&(RSI_H1<=53)&&(TradeTimeOk==1))
{
SendNotification("H1 RSI 50 Seviyesinde");
}
if((RSI_H1>=67)&&(RSI_H1<=70)&&(TradeTimeOk==1))
{
SendNotification("H1 RSI 70 Seviyesinde");
}
//////////////////////////////////////////////////+++++H1+++++




//////////////////////////////////////////////////+++++H4+++++
if((RSI_H4>=30)&&(RSI_H4<=33)&&(TradeTimeOk==1))
{
SendNotification("H4 RSI 30 Seviyesinde");
}
if((RSI_H4>=47)&&(RSI_H4<=50)&&(TradeTimeOk==1))
{
SendNotification("H4 RSI 50 Seviyesinde");
}
if((RSI_H4>=50)&&(RSI_H4<=53)&&(TradeTimeOk==1))
{
SendNotification("H4 RSI 50 Seviyesinde");
}
if((RSI_H4>=67)&&(RSI_H4<=70)&&(TradeTimeOk==1))
{
SendNotification("H4 RSI 70 Seviyesinde");
}
//////////////////////////////////////////////////+++++H4+++++




//////////////////////////////////////////////////+++++D1+++++
if((RSI_D1>=30)&&(RSI_D1<=33)&&(TradeTimeOk==1))
{
SendNotification("D1 RSI 30 Seviyesinde");
}
if((RSI_D1>=47)&&(RSI_D1<=50)&&(TradeTimeOk==1))
{
SendNotification("D1 RSI 50 Seviyesinde");
}
if((RSI_D1>=50)&&(RSI_D1<=53)&&(TradeTimeOk==1))
{
SendNotification("D1 RSI 50 Seviyesinde");
}
if((RSI_D1>=67)&&(RSI_D1<=70)&&(TradeTimeOk==1))
{
SendNotification("D1 RSI 70 Seviyesinde");
}
//////////////////////////////////////////////////+++++D1+++++




int Error=GetLastError();

  if(Error==2){Alert("COMMON_ERROR");}
  if(Error==4250){Alert("NOTIFICATION_SEND_FAILED");}
  if(Error==4251){Alert("NOTIFICATION_WRONG_PARAMETER");}
  if(Error==4252){Alert("NOTIFICATION_WRONG_SETTINGS");}
  if(Error==4253){Alert("NOTIFICATION_TOO_FREQUENT");}

   return(0);
}

 

Back to topics list  

To add comments, please log in or register