Forex
Google

Go Back   Forex Trading > Downloads > Expert Advisors - Metatrader 4
Forex Forum Register FAQ Members List Calendar Today's Posts


Register in Forex TSD!
Trading Systems Leaders in this forum (automated trading systems) are winning more than 3000 pips in a month (30000$ investing one lot every time).
Click here to register and get more information

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 03-30-2006, 07:47 PM
techinvest techinvest is offline
Member
 
Join Date: Dec 2005
Posts: 58
techinvest is on a distinguished road
Help Generating an Email Alert

Currently this is what I'm trying in my EA to update me via email about the health of my account:

if (Hour()==23 && Minute()==00)
SendMail("DLMod1", "Account Balance is-"+DoubleToStr(AccountBalance(),2)+"_Account Equity is-"+DoubleToStr(AccountEquity(),2)+
"_Account Profit is-"+DoubleToStr(AccountProfit(),2)+"_Account Margin is-"+DoubleToStr(AccountMargin(),2)+
"_Account Free Margin is-"+DoubleToStr(AccountFreeMargin(),2));


The problem is that if I add in a seconds value, if it doesn't get a tick that second I get no email, but in this configuration I get an email for every tick sometimes almost 100.

Can someone help me write this correctly so that I get only one email a day?

Thanks for your help!
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 03-31-2006, 09:18 PM
techinvest techinvest is offline
Member
 
Join Date: Dec 2005
Posts: 58
techinvest is on a distinguished road
anyone??????
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 03-31-2006, 09:56 PM
Nicholishen's Avatar
Nicholishen Nicholishen is offline
Senior Member
 
Join Date: Dec 2005
Posts: 531
Nicholishen is on a distinguished road
Quote:
Originally Posted by techinvest
anyone??????
Try this
PHP Code:
bool mail;
int start(){
   if (
Hour()>=23 && !mail){
      
SendMail("DLMod1""Account Balance is-"+DoubleToStr(AccountBalance(),2)+"_Account Equity is-"+DoubleToStr(AccountEquity(),2)+
      
"_Account Profit is-"+DoubleToStr(AccountProfit(),2)+"_Account Margin is-"+DoubleToStr(AccountMargin(),2)+
      
"_Account Free Margin is-"+DoubleToStr(AccountFreeMargin(),2));
      
mail=true;
   }
   if(
Hour()<23)mail=false;

__________________
"Anyone who has never made a mistake has never tried anything new." -Albert Einstein

Last edited by Nicholishen : 03-31-2006 at 10:00 PM.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 03-31-2006, 10:16 PM
gtd141 gtd141 is offline
Junior Member
 
Join Date: Jan 2006
Posts: 11
gtd141 is on a distinguished road
Another idea.

Code:
int SentEmail=0;

int start(){
   if (Hour()==23 && SentEmail!=DayOfYear())
   {
      SendMail("DLMod1", "Account Balance is-"+DoubleToStr(AccountBalance(),2)+"_Account Equity is-"+DoubleToStr(AccountEquity(),2)+ 
      "_Account Profit is-"+DoubleToStr(AccountProfit(),2)+"_Account Margin is-"+DoubleToStr(AccountMargin(),2)+ 
      "_Account Free Margin is-"+DoubleToStr(AccountFreeMargin(),2));
      SentEmail = DayOfYear();
   }
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #5 (permalink)  
Old 03-31-2006, 11:36 PM
techinvest techinvest is offline
Member
 
Join Date: Dec 2005
Posts: 58
techinvest is on a distinguished road
Thanks to you both. I think we have a winner in one of these!
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #6 (permalink)  
Old 05-23-2006, 03:43 AM
ajk's Avatar
ajk ajk is offline
Senior Member
 
Join Date: Dec 2005
Posts: 210
ajk is on a distinguished road
Email ... Alerts

Anyone know how to customize an alert using the sendmail command? I am having trouble getting an email to work off an alert .
Any advice would be appreciated.

if(current_dirction != last_direction)
{
Alert ("EMA/SMA Cross for "+Symbol()+" on the "+Period()+" minute chart.");
last_direction = current_dirction;
return (true);
}
else
{
return (false);
}
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


Similar Threads
Thread Thread Starter Forum Replies Last Post
EA generating 1-2%/per day Muddyguy Commercial Trading Systems and indicators 557 07-04-2008 05:50 AM
Email newdigital Tools and utilities 48 06-27-2008 12:22 AM
Email alert inside MT4 blewsky Setup Questions 1 12-28-2006 07:07 AM


All times are GMT. The time now is 08:54 AM.