Forex
Google
New signals service!

Go Back   Forex Trading > Discussion Areas > Metatrader 4


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 02-27-2006, 12:39 AM
Nicholishen's Avatar
Senior Member
 
Join Date: Dec 2005
Posts: 531
Nicholishen is on a distinguished road
Code to send email alerts when closed trades...

I was writing some code to send me email alerts after trades close, regardless of whether or not the expert closed the trade or the trade was closed via TP or SL. I have tested it and it works, however, I am having problems with the emails violating SMTP rules when use MT4's SendMail(). (see http://cr.yp.to/docs/smtplf.html)

Does anyone know how to get around or correct this problem, because this would be a VERY valuble tool, especially for those who need to focus time on other work and would like to keep up to speed on the account as trades are being executed. Personally, it would be great to have trades emailed to my BlackBerry to see the details after the trade is close. I appreciate any help!
Attached Files
File Type: mq4 MailAlert TEST.mq4 (2.2 KB, 142 views)

Last edited by Nicholishen; 02-27-2006 at 12:47 AM.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 02-27-2006, 01:21 AM
cockeyedcowboy's Avatar
Senior Member
 
Join Date: Nov 2005
Posts: 267
cockeyedcowboy is on a distinguished road
Nicholishen


Try to send emails to other address, like some friend that receives email on different sever then yours. I use a mailer to send messages to myself from MetaQuote and I get errors when sending to HotMail.com addresses, the emailer wont work. Thats the only email sever I can't send to. LF means LINE FEED. In your message it mentions MSN net work which includes hotmail.com. Also some email severs donot permit you to email to the address from which the mail originates from as well. Emailing to a friend will at least eliminate the above conditions from the list.

I have not used the mailer that comes with MQ. I use a third party software, as MQ didnot have that function back in v3.xx I have not rewriten my communication module to use the built-in mailer yet, plan to do this in the near future.

The CockeyedCowboy

Last edited by cockeyedcowboy; 02-27-2006 at 01:27 AM.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 02-27-2006, 01:24 AM
Nicholishen's Avatar
Senior Member
 
Join Date: Dec 2005
Posts: 531
Nicholishen is on a distinguished road
fixed

...It seems that it did not like my "\n" statements.

To use the mail alert you must first setup MT preferences. If you haven't yet done it, you would go to: TOOLS>OPTIONS>EMAIL. Enable the email feature and set the preferences for SMTP.

Depending on how you intend to use it you can insert it into your code and change the subject to the name of the advisor. Make sure to add filters to the qualifying if statement. An example is inserted but commented out. Optionally you can just#include as a generic mailer.

The benefit of this is to have the system email you the details of closed trades; even when they have closed due to SL or TP.

I would appreciate feedback as to what details you would like to see in the email.
Attached Files
File Type: mq4 MailAlert TEST.mq4 (2.4 KB, 169 views)

Last edited by Nicholishen; 02-27-2006 at 01:49 AM.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 02-27-2006, 01:26 AM
Nicholishen's Avatar
Senior Member
 
Join Date: Dec 2005
Posts: 531
Nicholishen is on a distinguished road
Quote:
Originally Posted by cockeyedcowboy
Nicholishen


Try to send emails to other address, like some friend that receives email on different sever then yours. I use a mailer to send messages to myself from MetaQuote and I get errors when sending to HotMail.com addresses, the emailer wont work. Thats the only email sever I can't send to. LF means LINE FEED. In your message it mentions MSN net work which includes hotmail.com. Also some email severs donot permit you to email to the address from which the mail originates from as well. Emailing to a friend will at least eliminate the above conditions from the list.

I have not used the mailer that comes with MQ. I use a third party software, as MQ didnot have that function back in v3.xx I have not rewriten my communication module to use the built-in mail yet, plan to do this in the near future.

The CockeyedCowboy

...looks like we posted at same time. Thanks for the info!
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

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

BB 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
Send Email On Pre Set Time not Working, event is not firing ! icm63 Metatrader 4 2 03-26-2007 07:55 AM
Email Alerts - SMTP Server cballew General Discussion 1 03-16-2007 02:17 PM
Using CCI to trigger Email alerts techtrader Metatrader 4 2 05-30-2006 12:58 PM


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



Search Engine Friendly URLs by vBSEO 3.2.0 ©2008, Crawlability, Inc.