This forum is now read-only. You can discuss you questions on Forums of MQL4.community and MQL5.community
I need helpBack to topics list |
|
savr
2005.05.23 22:54
Can somebody supply me with the following programming:
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. |
|
mpfx
2005.05.23 23:58
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); } //+------------------------------------------------------------------+ |
