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 06-18-2006, 05:26 AM
Junior Member
 
Join Date: Apr 2006
Posts: 16
compro99 is on a distinguished road
EMA Alert help !!!!!!!!!!

Hi all,

Can someone help me with the below EMA crossover alert ?

I used it on a 5 mins chart and it is generating alot of email alerts. How can i reduce it ?? Please help !!!!!! Thanks...


================================================== =======

//---- input parameters
extern int FastEMA=3;
extern int SlowEMA=34;
extern int SlowEM2=89;

double FASTEMACURRENT,FASTEMAPREVIOUS,SLOWEMACURRENT,SLOW EMAPREVIOUS;
double SLOWEMACURRENT2,SLOWEMAPREVIOUS2;

//+------------------------------------------------------------------+
//| Custom indicator initialization function |
//+------------------------------------------------------------------+
int init()
{
return(0);
}
//+------------------------------------------------------------------+
//| Custom indicator deinitialization function |
//+------------------------------------------------------------------+
int deinit()
{
//----

//----
return(0);
}

int start()
{

FASTEMACURRENT=iMA(NULL,0,3,0,MODE_EMA,PRICE_CLOSE ,0);
FASTEMAPREVIOUS=iMA(NULL,0,3,0,MODE_EMA,PRICE_CLOS E,1);
SLOWEMACURRENT=iMA(NULL,0,34,0,MODE_EMA,PRICE_CLOS E,0);
SLOWEMAPREVIOUS=iMA(NULL,0,34,0,MODE_EMA,PRICE_CLO SE,1);
SLOWEMACURRENT2=iMA(NULL,0,89,0,MODE_EMA,PRICE_CLO SE,0);
SLOWEMAPREVIOUS2=iMA(NULL,0,89,0,MODE_EMA,PRICE_CL OSE,1);

// EMA34 Crossover
if (FASTEMACURRENT > SLOWEMACURRENT && FASTEMAPREVIOUS < SLOWEMAPREVIOUS)
{
SendMail(Symbol()+" 34EMA Bullish",Symbol()+" 34EMA Cross Up");

}
if (FASTEMACURRENT < SLOWEMACURRENT && FASTEMAPREVIOUS > SLOWEMAPREVIOUS)
{
SendMail(Symbol()+" 34EMA Bearish",Symbol()+" 34EMA Cross Down");

}

// EMA89 Crossover
if (FASTEMACURRENT > SLOWEMACURRENT2 && FASTEMAPREVIOUS < SLOWEMAPREVIOUS2)
{
SendMail(Symbol()+" 89EMA Bullish",Symbol()+" 89EMA Cross Up");

}
if (FASTEMACURRENT < SLOWEMACURRENT2 && FASTEMAPREVIOUS > SLOWEMAPREVIOUS2)
{
SendMail(Symbol()+" 89EMA Bearish",Symbol()+" 89EMA Cross Down");

}

}
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
  #2 (permalink)  
Old 06-18-2006, 07:22 AM
elihayun's Avatar
Senior Member
 
Join Date: Jan 2006
Posts: 396
elihayun is on a distinguished road
Quote:
Originally Posted by compro99
Hi all,

Can someone help me with the below EMA crossover alert ?

I used it on a 5 mins chart and it is generating alot of email alerts. How can i reduce it ?? Please help !!!!!! Thanks...


================================================== =======

//---- input parameters
extern int FastEMA=3;
extern int SlowEMA=34;
extern int SlowEM2=89;

double FASTEMACURRENT,FASTEMAPREVIOUS,SLOWEMACURRENT,SLOW EMAPREVIOUS;
double SLOWEMACURRENT2,SLOWEMAPREVIOUS2;

//+------------------------------------------------------------------+
//| Custom indicator initialization function |
//+------------------------------------------------------------------+
int init()
{
return(0);
}
//+------------------------------------------------------------------+
//| Custom indicator deinitialization function |
//+------------------------------------------------------------------+
int deinit()
{
//----

//----
return(0);
}

int start()
{

FASTEMACURRENT=iMA(NULL,0,3,0,MODE_EMA,PRICE_CLOSE ,0);
FASTEMAPREVIOUS=iMA(NULL,0,3,0,MODE_EMA,PRICE_CLOS E,1);
SLOWEMACURRENT=iMA(NULL,0,34,0,MODE_EMA,PRICE_CLOS E,0);
SLOWEMAPREVIOUS=iMA(NULL,0,34,0,MODE_EMA,PRICE_CLO SE,1);
SLOWEMACURRENT2=iMA(NULL,0,89,0,MODE_EMA,PRICE_CLO SE,0);
SLOWEMAPREVIOUS2=iMA(NULL,0,89,0,MODE_EMA,PRICE_CL OSE,1);

// EMA34 Crossover
if (FASTEMACURRENT > SLOWEMACURRENT && FASTEMAPREVIOUS < SLOWEMAPREVIOUS)
{
SendMail(Symbol()+" 34EMA Bullish",Symbol()+" 34EMA Cross Up");

}
if (FASTEMACURRENT < SLOWEMACURRENT && FASTEMAPREVIOUS > SLOWEMAPREVIOUS)
{
SendMail(Symbol()+" 34EMA Bearish",Symbol()+" 34EMA Cross Down");

}

// EMA89 Crossover
if (FASTEMACURRENT > SLOWEMACURRENT2 && FASTEMAPREVIOUS < SLOWEMAPREVIOUS2)
{
SendMail(Symbol()+" 89EMA Bullish",Symbol()+" 89EMA Cross Up");

}
if (FASTEMACURRENT < SLOWEMACURRENT2 && FASTEMAPREVIOUS > SLOWEMAPREVIOUS2)
{
SendMail(Symbol()+" 89EMA Bearish",Symbol()+" 89EMA Cross Down");

}

}
return (0);


================================================== =======
Add this at the end of your indicator


bool NewBar()
{
static datetime dt = 0;
if (dt != Time[0])
{
dt = Time[0]; Sleep(100); // wait for tick
return(true);
}
return(false);
}


and change SendMail to this if (NewBar()) SendMail .........
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 06-18-2006, 01:47 PM
Junior Member
 
Join Date: Apr 2006
Posts: 16
compro99 is on a distinguished road
Elihayun,

How do i do that ? I am not so good in programming.

Kinda confused with the new add on. Will it works in 1hr chart too ?

Please help to piece up. Thanks you.
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 06-18-2006, 01:51 PM
elihayun's Avatar
Senior Member
 
Join Date: Jan 2006
Posts: 396
elihayun is on a distinguished road
Quote:
Originally Posted by compro99
Elihayun,

How do i do that ? I am not so good in programming.

Kinda confused with the new add on. Will it works in 1hr chart too ?

Please help to piece up. Thanks you.
post it here as an attachment, I will correct it for u
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 06-18-2006, 02:34 PM
Junior Member
 
Join Date: Apr 2006
Posts: 16
compro99 is on a distinguished road
Elihayun,

I appreciate your kind help. For your information, i would be using this EA for 30mins and 1 hour chart.

I would like to get email alert when EMA3 crossover EMA34 and EMA3 crossover EMA89. I would not want any repeated alert. I know the repeated alerts was due to current bar moving up/down when price increases/decreases.

Thanks for the help again.
Attached Files
File Type: mq4 EmaAlert.mq4 (1.7 KB, 66 views)

Last edited by compro99; 06-18-2006 at 02:46 PM.
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 06-18-2006, 03:13 PM
elihayun's Avatar
Senior Member
 
Join Date: Jan 2006
Posts: 396
elihayun is on a distinguished road
Quote:
Originally Posted by compro99
Elihayun,

I appreciate your kind help. For your information, i would be using this EA for 30mins and 1 hour chart.

I would like to get email alert when EMA3 crossover EMA34 and EMA3 crossover EMA89. I would not want any repeated alert. I know the repeated alerts was due to current bar moving up/down when price increases/decreases.

Thanks for the help again.
I just aded the code to prevent multiple alert/email. I didn't change the rest
Attached Files
File Type: mq4 EmaAlert.mq4 (1.9 KB, 101 views)
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 06-18-2006, 03:25 PM
Junior Member
 
Join Date: Apr 2006
Posts: 16
compro99 is on a distinguished road
Will there be any implication if the ema crossup and then quick reverse crossdown ?

Will it affect the alert ? Jus curious... based on yr programming experience.
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 06-18-2006, 03:34 PM
elihayun's Avatar
Senior Member
 
Join Date: Jan 2006
Posts: 396
elihayun is on a distinguished road
Quote:
Originally Posted by compro99
Will there be any implication if the ema crossup and then quick reverse crossdown ?

Will it affect the alert ? Jus curious... based on yr programming experience.
if this will be in the same bar ( I mean if the cross up will start u will get an alert. If the bar will not close and a reverse apears, u will not get another alert. U right then.
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
  #9 (permalink)  
Old 06-19-2006, 01:01 AM
Junior Member
 
Join Date: Apr 2006
Posts: 16
compro99 is on a distinguished road
Thumbs up

Elihayun,

I still got alot of repeated alerts within the same bar. Could u please help to see if there is any logic errors ? Thanks alot

Last edited by compro99; 06-19-2006 at 01:14 AM.
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
  #10 (permalink)  
Old 06-19-2006, 06:01 AM
elihayun's Avatar
Senior Member
 
Join Date: Jan 2006
Posts: 396
elihayun is on a distinguished road
Quote:
Originally Posted by compro99
Elihayun,

I still got alot of repeated alerts within the same bar. Could u please help to see if there is any logic errors ? Thanks alot
Did u compile my version?
I noticed that this is not an indicator, its EA. I put it in my demo account and I will see what will be
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

Tags
EMA alert


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
EMA with alert? pipmonger12 Metatrader 4 21 11-12-2009 05:03 PM
ADX alert!! connecting4less Indicators - Metatrader 4 37 10-14-2009 03:27 PM
How to set alert? Woodcrusher Indicators - Metatrader 4 2 01-09-2007 09:48 AM


All times are GMT. The time now is 06:05 AM.



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