Forex



Go Back   Forex Trading > Downloads > Expert Advisors - Metatrader 4
Forex Forum Register More recent Blogs Calendar Advertising Others Help






Register
Welcome to Forex-TSD!, one of the largest Forex forums worldwide, where you will be able to find the most complete and reliable Forex information imaginable.

From the list below, select the forum that you want to visit and register to post, as many times you want. It’s absolutely free. Click here for registering on Forex-TSD.

Exclusive Forum
The Exclusive Forum is the only paid section. Once you subscribe, you will get free access to real cutting-edge Trading Systems (automated and not), Indicators, Signals, Articles, etc., that will help and guide you, in ways that you could only imagine, with your Forex trading.
  • Elite Section
    Get access to private discussions, specialized support, indicators and trading systems reported every week.
  • Advanced Elite Section
    For professional traders, trading system developers and any other member who may need to use and/or convert, the most cutting-edge exclusive indicators and trading systems for MT4 and MT5.
See more

Reply
 
Thread Tools Display Modes
  #1 (permalink)  
Old 05-15-2006, 10:22 PM
babarmughal's Avatar
Senior Member
 
Join Date: Apr 2006
Posts: 315
babarmughal is on a distinguished road
Smile Script to Send Emails

Hi GUys,

How can I add script in EA so that it sends an email when ever there is a signal to BUY or SELL....

Thanks
Babar
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!StumbleUpon this Post!Reddit this Post!Facebook this Post!BlinkList this Post!Google Bookmarks this Post!Yahoo! My Web this Post!
Reply With Quote
  #2 (permalink)  
Old 05-15-2006, 10:36 PM
Senior Member
 
Join Date: Mar 2006
Posts: 793
Maji is on a distinguished road
This should get you started.

Maji

Code:
//+------------------------------------------------------------------+
//|                                                 EMailSignals.mq4 |
//+------------------------------------------------------------------+
#property copyright "Sample"
#property link      "Sample"

extern int RSIPeriod=14;
extern int RSIPrice=PRICE_CLOSE;

extern int MAFastPeriod=5;
extern int MAFastShift=0;
extern int MAFastMethod=MODE_SMA;
extern int MAFastPrice=PRICE_CLOSE;
extern int MASlowPeriod=10;
extern int MASlowShift=0;
extern int MASlowMethod=MODE_SMA;
extern int MASlowPrice=PRICE_CLOSE;

bool runnable=true;
bool initialize=true;

datetime timeprev=0;

int init()
{
 return(0);
}

int deinit()
{
 return(0);
}

int start()
{
//Runnable
 if(runnable!=true)
  return(-1);
  
 
//
//New Bar
//
 if(timeprev==Time[0])
  return(0);
 timeprev=Time[0];
 
//
//Calculation
//
 double fast01=iMA(NULL,0,MAFastPeriod,MAFastShift,MAFastMethod,MAFastPrice,1);
 double fast02=iMA(NULL,0,MAFastPeriod,MAFastShift,MAFastMethod,MAFastPrice,2);
 double slow01=iMA(NULL,0,MASlowPeriod,MASlowShift,MASlowMethod,MASlowPrice,1);
 double slow02=iMA(NULL,0,MASlowPeriod,MASlowShift,MASlowMethod,MASlowPrice,2);

 double rsi01=iRSI(NULL,0,RSIPeriod,RSIPrice,1);
 double rsi02=iRSI(NULL,0,RSIPeriod,RSIPrice,2);

//Long
 if(fast01>slow01&&fast02<slow02)
  SendMail("MA Cross Long","MA crossed UP");
 if(rsi01>50&&rsi02<50)
  SendMail("RSI Cross Long","RSI crossed long 50");
 
//Shrt
 if(fast01<slow01&&fast02>slow02)
  SendMail("MA Cross Shrt","MA crossed DN");
 if(rsi01<50&&rsi02>50)
  SendMail("RSI Cross Shrt","RSI crossed shrt 50");


 return(0);
}
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!StumbleUpon this Post!Reddit this Post!Facebook this Post!BlinkList this Post!Google Bookmarks this Post!Yahoo! My Web this Post!
Reply With Quote
  #3 (permalink)  
Old 05-15-2006, 11:19 PM
codersguru's Avatar
Senior Member
 
Join Date: Oct 2005
Posts: 994
codersguru has a spectacular aura aboutcodersguru has a spectacular aura aboutcodersguru has a spectacular aura about
And maybe you should try this :
Tools - Send email with attachment from MetaTrader (Mail Anywhere)!
__________________
Hope it helps !
Coders' Guru
Senior MQL programmer:
www.xpworx.com/custom.htm
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!StumbleUpon this Post!Reddit this Post!Facebook this Post!BlinkList this Post!Google Bookmarks this Post!Yahoo! My Web this Post!
Reply With Quote
  #4 (permalink)  
Old 05-15-2006, 11:54 PM
babarmughal's Avatar
Senior Member
 
Join Date: Apr 2006
Posts: 315
babarmughal is on a distinguished road
Smile

Thanks for your reply guys....still its not clear that what line do I have to enter in the EA for sending emails.....

Thanks
Babar
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!StumbleUpon this Post!Reddit this Post!Facebook this Post!BlinkList this Post!Google Bookmarks this Post!Yahoo! My Web this Post!
Reply With Quote
  #5 (permalink)  
Old 05-16-2006, 12:04 AM
babarmughal's Avatar
Senior Member
 
Join Date: Apr 2006
Posts: 315
babarmughal is on a distinguished road
Smile

I Have tried sending email but in journalit say......

550 you are not allowed to send mail

can someone tell me why ?????

Thanks
Babar
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!StumbleUpon this Post!Reddit this Post!Facebook this Post!BlinkList this Post!Google Bookmarks this Post!Yahoo! My Web this Post!
Reply With Quote
  #6 (permalink)  
Old 05-16-2006, 12:14 AM
Member
 
Join Date: Feb 2006
Posts: 81
laserjet is on a distinguished road
Quote:
Originally Posted by babarmughal
I Have tried sending email but in journalit say......

550 you are not allowed to send mail

can someone tell me why ?????

Thanks
Babar
Set email setting in Tools / Options / Email, make sure email setting are ok, like smtp server, account name and password, and make sure youe email service provider allow you to send email. Like we cann't use hotmail and yahoo accounts.

Also test if eveything is ok by press test.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!StumbleUpon this Post!Reddit this Post!Facebook this Post!BlinkList this Post!Google Bookmarks this Post!Yahoo! My Web this Post!
Reply With Quote
  #7 (permalink)  
Old 05-16-2006, 12:30 AM
babarmughal's Avatar
Senior Member
 
Join Date: Apr 2006
Posts: 315
babarmughal is on a distinguished road
Smile

Hi

I have tried everything ...but no luck....I am using North Finance...it could be that they dont support this option in DEMO...

Thanks
Babar
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!StumbleUpon this Post!Reddit this Post!Facebook this Post!BlinkList this Post!Google Bookmarks this Post!Yahoo! My Web this Post!
Reply With Quote
  #8 (permalink)  
Old 05-16-2006, 03:27 AM
firedave's Avatar
Senior Member
 
Join Date: Nov 2005
Location: Jakarta, Indonesia
Posts: 414
firedave is on a distinguished road
Quote:
Originally Posted by babarmughal
Hi

I have tried everything ...but no luck....I am using North Finance...it could be that they dont support this option in DEMO...

Thanks
Babar
Hi Babar, check this thread Setting up the email option in metatrader 4 maybe the problem is on your email setting. Hope this help
__________________
David Michael H
"Trader helps traders with sincerity, honesty and integrity"
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!StumbleUpon this Post!Reddit this Post!Facebook this Post!BlinkList this Post!Google Bookmarks this Post!Yahoo! My Web this Post!
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
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 Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Help with Send Mail cardio Setup Questions 7 10-23-2006 04:51 AM
Send Order problem intelligent_14 Questions 0 08-03-2006 11:37 AM
Reading Emails messup000 Metatrader 4 1 05-15-2006 09:58 AM


All times are GMT. The time now is 01:26 PM.



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