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
06-18-2006, 05:26 AM
Junior Member
Join Date: Apr 2006
Posts: 16
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);
================================================== =======
06-18-2006, 07:22 AM
Senior Member
Join Date: Jan 2006
Posts: 396
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 .........
06-18-2006, 01:47 PM
Junior Member
Join Date: Apr 2006
Posts: 16
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.
06-18-2006, 01:51 PM
Senior Member
Join Date: Jan 2006
Posts: 396
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
06-18-2006, 02:34 PM
Junior Member
Join Date: Apr 2006
Posts: 16
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.
Last edited by compro99; 06-18-2006 at 02:46 PM .
06-18-2006, 03:13 PM
Senior Member
Join Date: Jan 2006
Posts: 396
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
06-18-2006, 03:25 PM
Junior Member
Join Date: Apr 2006
Posts: 16
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.
06-18-2006, 03:34 PM
Senior Member
Join Date: Jan 2006
Posts: 396
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.
06-19-2006, 01:01 AM
Junior Member
Join Date: Apr 2006
Posts: 16
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 .
06-19-2006, 06:01 AM
Senior Member
Join Date: Jan 2006
Posts: 396
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
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
Thread Tools
Display Modes
Linear Mode
Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
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 .