Try re working this code
It sends an email each day at 2:00am sever time
If the hour = 2 it sends mail, and sets flag to 1
When hour = 3 it re sets flag to 0
int start()
{
static int flag;
if (flag ==0)
if ( Hour()==2)
{
SendMail(" Daily Alert "," PROFIT:$" +DoubleToStr(AccountProfit(),2)
+ " BALANCE:$" +DoubleToStr(AccountBalance(),2)
+ " BID:" +DoubleToStr(Bid,4)
+ " OPEN:" +DoubleToStr(Open[0], 4)
+ " LOW:" +DoubleToStr(Low[0],4)
+ " HIGH:" +DoubleToStr(High[0],4)
);
flag = 1 ;
Print(" Daily Email Alert Sent ");
}
if ( Hour()==3 )
{flag = 0;}
return(0);
}
//+------------------------------------------------------------------+
It sends an email each day at 2:00am sever time
If the hour = 2 it sends mail, and sets flag to 1
When hour = 3 it re sets flag to 0
int start()
{
static int flag;
if (flag ==0)
if ( Hour()==2)
{
SendMail(" Daily Alert "," PROFIT:$" +DoubleToStr(AccountProfit(),2)
+ " BALANCE:$" +DoubleToStr(AccountBalance(),2)
+ " BID:" +DoubleToStr(Bid,4)
+ " OPEN:" +DoubleToStr(Open[0], 4)
+ " LOW:" +DoubleToStr(Low[0],4)
+ " HIGH:" +DoubleToStr(High[0],4)
);
flag = 1 ;
Print(" Daily Email Alert Sent ");
}
if ( Hour()==3 )
{flag = 0;}
return(0);
}
//+------------------------------------------------------------------+
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
I use an hourly chart and I get to the point where mt4 send me an email when certain conditions are true, but
how do I stop the emails until the next hour?
thank you.