is it possible?

 
when i set up my alert it works perfectly with repeating.
but when i change alert with sendmail it's going crazy.

i'm getting messages every 1 second even i set up sleep function for 20 sec.
when i close my expert advisor (after i do compile) and my trade station mt4, and then go back to mt4 my alert advisor
is activated but sendmail is no ok!!!!



why??
 

... Show your code

 
phy:

... Show your code

int LIVE = 22;
while(AccountNumber() == LIVE)
{

if(AccountProfit()<AccountMargin())

SendMail(" ", " "+AccountProfit());
Sleep(5000);
   }
 

I really can't understand what you are saying, but...

While your account number is 22 you are trapped in the loop. If your profit is less than your margin it also sends mail. There is no exit from the loop.

 
int LIVE = 22;
 
while(AccountNumber() == LIVE)
   {
 
   if(AccountProfit()<AccountMargin())  SendMail(" ", " "+AccountProfit()); 
   Sleep(5000);
   }
 
while to if
 
phy:

I really can't understand what you are saying, but...

While your account number is 22 you are trapped in the loop. If your profit is less than your margin it also sends mail. There is no exit from the loop.

 
int LIVE = 22;
 
while(AccountNumber() == LIVE)
   {
 
   if(AccountProfit()<AccountMargin())  SendMail(" ", " "+AccountProfit()); 
   Sleep(5000);
DxdCn:
while to if
I KNOW THAT I'M TRAPPED IN THE LOOP AND IT'S OK.

i just wont that my EXPERT ADVISOR IS CHECKING MY ACCOUNT EVERY (IN THIS CASE 5 SEC.) AND IF ACCOUNT PROFIT IS < ACCOUNT MARGIN)
I WONT TO KNOW THAT. I WONT SMS FOR THIS.


WHAT YOU MEAN WHILE TO IF
   }
 

Check first with Print() how often it will print, maybe if you dont have AccountProfit()<AccountMargin()

it dont must to print, and if its all ok with Print, then look at Sendmail and so you go step by step to find a error.

Reason: