• Home
  • Forums
  • Trades
  • News
  • Calendar
  • Market
  • Brokers
  • Login
  • Join
  • User/Email: Password:
  • 10:40pm
Menu
  • Forums
  • Trades
  • News
  • Calendar
  • Market
  • Brokers
  • Login
  • Join
  • 10:40pm
Sister Sites
  • Metals Mine
  • Energy EXCH
  • Crypto Craft

Options

Bookmark Thread

First Page First Unread Last Page Last Post

Print Thread

Similar Threads

Help. EMA Crossover with different EMA cross for exit 0 replies

EMA crossover (ema 14 & 34) 4 replies

Please help code an EMA Crossover 12ema x 24 ema cross 1 reply

Price / Ema 21 Crossover Audio Alert 6 replies

EMA 84 Crossover Alert 1 reply

  • Platform Tech
  • /
  • Reply to Thread
  • Subscribe
  • 8
Attachments: EMA crossover Email Alert
Exit Attachments

EMA crossover Email Alert

  • Last Post
  •  
  • Page 1 234 5
  • Page 1 234 5
  •  
  • Post #1
  • Quote
  • First Post: Jun 9, 2006 12:06am Jun 9, 2006 12:06am
  •  compro99
  • | Joined Aug 2004 | Status: Member | 481 Posts
Does anyone here know how to program Email Alert for EMA crossover in MT4 ?

I am looking 1 hr chart for price crossover 34 EMA + 3 pips = Email Alert.

Any expert here can help with MT4 programming ?

Thanks.
The future depends on what we do in the present.
  • Post #2
  • Quote
  • Jun 9, 2006 2:46am Jun 9, 2006 2:46am
  •  trucco
  • | Joined May 2006 | Status: Member | 636 Posts
As mt4 looks a C derivated language to me (I didnt use it , just saw 5 minutes), I believe , I hope.., you can add includes files (with SMTP PROTOCOL) to send emails.
Build smtp functions by yourself , especially if you don't have socks functions, is too hard.
First understand if you can include external libraries, if yes, look on internet, there plenty of smtp-pop3 libraries
Good luck
 
 
  • Post #3
  • Quote
  • Jun 9, 2006 2:49am Jun 9, 2006 2:49am
  •  trucco
  • | Joined May 2006 | Status: Member | 636 Posts
I think you can.

I just saw in opne include script the import function for external DLL libraries.
So you must look on the internet for DLL SMTP/POP3 libraries, include this into your project and use internat functions of this library to send emails
 
 
  • Post #4
  • Quote
  • Jun 9, 2006 2:51am Jun 9, 2006 2:51am
  •  trucco
  • | Joined May 2006 | Status: Member | 636 Posts
EXAMPLE:


import "user32.dll"


void keybd_event(int bVk,int bScan,int dwFlags,int dwExtraInfo);
int SendMessageA(int hWnd,int Msg,int wParam,int lParam);
int SendNotifyMessageA(int hWnd,int Msg,int wParam,int lParam);


first you import, then you decleare the internal functions of that dll file to use the functions into your script.

(this dll is not for mails)
 
 
  • Post #5
  • Quote
  • Jun 9, 2006 7:07am Jun 9, 2006 7:07am
  •  dof
  • | Joined Mar 2006 | Status: Member | 447 Posts
Quoting compro99
Disliked
Does anyone here know how to program Email Alert for EMA crossover in MT4 ?

I am looking 1 hr chart for price crossover 34 EMA + 3 pips = Email Alert.

Any expert here can help with MT4 programming ?

Thanks.
Ignored
I made one, see if it's good.
Attached File
File Type: mq4 EmaCross.mq4   2 KB | 3,712 downloads
Try hard, think fast, die young
 
 
  • Post #6
  • Quote
  • Jun 9, 2006 7:31am Jun 9, 2006 7:31am
  •  bundyraider
  • Joined Feb 2006 | Status: 'Try-hard' extraordinaire... | 2,151 Posts
MT4 already has a command for sending an e-mail.

SendMail()

It'll send a message to the e-mail address specified in your MT4 preferences:-

SendMail("From your MA Crossover Expert", "MA3 has Crossed Over MA4 Blah Blah" );
Bundy's status today: "Waiting..."
 
 
  • Post #7
  • Quote
  • Jun 9, 2006 7:37am Jun 9, 2006 7:37am
  •  trucco
  • | Joined May 2006 | Status: Member | 636 Posts
Quoting bundyraider
Disliked
MT4 already has a command for sending an e-mail.

SendMail()

It'll send a message to the e-mail address specified in your MT4 preferences:-

SendMail("From your MA Crossover Expert", "MA3 has Crossed Over MA4 Blah Blah" );
Ignored
nice one
I didnt know
Thanks
 
 
  • Post #8
  • Quote
  • Jun 9, 2006 7:38am Jun 9, 2006 7:38am
  •  trucco
  • | Joined May 2006 | Status: Member | 636 Posts
I installed now metaquotes metatrader 4.0

Do you know once you made your script in your edit section, and you compiled, how you run it ?!
I mean, how is activated ?

Thanks!
 
 
  • Post #9
  • Quote
  • Jun 9, 2006 9:46am Jun 9, 2006 9:46am
  •  twoblink
  • Joined May 2006 | Status: Member | 889 Posts
That's so awesome..

All you need to do is:
Alarm -> Email -> PDA and you've got a mobile trading system
google:
 
 
  • Post #10
  • Quote
  • Jun 9, 2006 2:00pm Jun 9, 2006 2:00pm
  •  compro99
  • | Joined Aug 2004 | Status: Member | 481 Posts
DOF, thanks.

I've made one too. But it give alot of alerts... damn.

Anyone can help to reduce the alert ?
Attached File
File Type: mq4 EmaAlert.mq4   1 KB | 1,824 downloads
The future depends on what we do in the present.
 
 
  • Post #11
  • Quote
  • Jun 9, 2006 10:01pm Jun 9, 2006 10:01pm
  •  bundyraider
  • Joined Feb 2006 | Status: 'Try-hard' extraordinaire... | 2,151 Posts
Quoting compro99
Disliked
DOF, thanks.

I've made one too. But it give alot of alerts... damn.

Anyone can help to reduce the alert ?
Ignored
Yeah , I actually started to make a quick EA for you last night but when I realised I needed to filter it from triggering too often I stopped. Was too tired . LOL

You could check that the price was the OPPOSITE side of your trigger side the last bar ago. Or maybe was the otherside for the last 2 or more conesuctive bars or something to allow for the occasional tight whip-saw. You might have to play with it a little to see what works best.
Bundy's status today: "Waiting..."
 
 
  • Post #12
  • Quote
  • Edited at 10:18pm Jun 9, 2006 10:09pm | Edited at 10:18pm
  •  bundyraider
  • Joined Feb 2006 | Status: 'Try-hard' extraordinaire... | 2,151 Posts
Quoting twoblink
Disliked
That's so awesome..

All you need to do is:
Alarm -> Email -> PDA and you've got a mobile trading system
Ignored
Yeah, I brain stormed on that when I read it. You could even trade your MetaTrade by SMS if you created a .DLL that you have watching for return messages. Good shit!

Would be a little work though.

For example I have my PAP signals going to Yahoo, which allows alerts to SMS based on filters.
I've done the same for my MetaTrade alerts. Anything coming from my home e-mail address to my yahoo one forwards on.

I can set alert levels and go outside or shopping or whatever.
Or even long term support/resistance breaks on currency pairs I aint watching closely.
i.e I received an SMS yesterday containing an alert that told me my trade had hit a Pivot line I expected a possible reversal at.

I'ma luvin' it!!
Bundy's status today: "Waiting..."
 
 
  • Post #13
  • Quote
  • Jun 13, 2006 6:12am Jun 13, 2006 6:12am
  •  trucco
  • | Joined May 2006 | Status: Member | 636 Posts
Maybe somebody has an Stochastic and RSI alert system ?

Im trying to understand it but I cant really get it.

I was looking into the Stochastic indicator script.

Thanks!

Christian
 
 
  • Post #14
  • Quote
  • Jun 13, 2006 6:22am Jun 13, 2006 6:22am
  •  trucco
  • | Joined May 2006 | Status: Member | 636 Posts
Quoting trucco
Disliked
Maybe somebody has an Stochastic and RSI alert system ?

Im trying to understand it but I cant really get it.

I was looking into the Stochastic indicator script.

Thanks!

Christian
Ignored

Somebody know how into mt4 is the Stochastic and RSI level indicated ?
I mean, which object/variable, returns me the current RSI or Stochastic ?
Cheers
 
 
  • Post #15
  • Quote
  • Jun 17, 2006 10:12pm Jun 17, 2006 10:12pm
  •  compro99
  • | Joined Aug 2004 | Status: Member | 481 Posts
//---- input parameters
extern int FastEMA=3;
extern int SlowEMA=34;
extern int SlowEM2=89;

double FASTEMACURRENT,FASTEMAPREVIOUS,SLOWEMACURRENT,SLOWEMAPREVIOUS;
double SLOWEMACURRENT2,SLOWEMAPREVIOUS2;
//+------------------------------------------------------------------+
//| expert initialization function |
//+------------------------------------------------------------------+
int start()
{

FASTEMACURRENT=iMA(NULL,0,3,0,MODE_EMA,PRICE_CLOSE,0);
FASTEMAPREVIOUS=iMA(NULL,0,3,0,MODE_EMA,PRICE_CLOSE,1);
SLOWEMACURRENT=iMA(NULL,0,34,0,MODE_EMA,PRICE_CLOSE,0);
SLOWEMAPREVIOUS=iMA(NULL,0,34,0,MODE_EMA,PRICE_CLOSE,1);
SLOWEMACURRENT2=iMA(NULL,0,89,0,MODE_EMA,PRICE_CLOSE,0);
SLOWEMAPREVIOUS2=iMA(NULL,0,89,0,MODE_EMA,PRICE_CLOSE,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);


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


Hi all,

I am able to get alert for above EMA cross but it is giving alotttt of repeated alerts. How can reduce it to just 2 alerts for per ema cross ? Please help !!!
The future depends on what we do in the present.
 
 
  • Post #16
  • Quote
  • Jun 18, 2006 6:00am Jun 18, 2006 6:00am
  •  bundyraider
  • Joined Feb 2006 | Status: 'Try-hard' extraordinaire... | 2,151 Posts
Try these changes dude.

All additions in coloured text. Nothing has been removed.

I haven't tested this, but should be straight forward. Should put you on the right path at least. Probably don't need to check previous MAs now either. LOL.

Quoting compro99
Disliked
// Define a couple of constants to make
// code more readable...

#Define Bullish 1
#Define Bearish -1

// Define variables to hold current EMA States...

int 34EMA_state = NULL;
int 89EMA_state = NULL;


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

double FASTEMACURRENT,FASTEMAPREVIOUS,SLOWEMACURRENT,SLOWEMAPREVIOUS;
double SLOWEMACURRENT2,SLOWEMAPREVIOUS2;
//+------------------------------------------------------------------+
//| expert initialization function |
//+------------------------------------------------------------------+
int start()
{

FASTEMACURRENT=iMA(NULL,0,3,0,MODE_EMA,PRICE_CLOSE,0);
FASTEMAPREVIOUS=iMA(NULL,0,3,0,MODE_EMA,PRICE_CLOSE,1);
SLOWEMACURRENT=iMA(NULL,0,34,0,MODE_EMA,PRICE_CLOSE,0);
SLOWEMAPREVIOUS=iMA(NULL,0,34,0,MODE_EMA,PRICE_CLOSE,1);
SLOWEMACURRENT2=iMA(NULL,0,89,0,MODE_EMA,PRICE_CLOSE,0);
SLOWEMAPREVIOUS2=iMA(NULL,0,89,0,MODE_EMA,PRICE_CLOSE,1);

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

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

}

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

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

}

}
return (0);


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


Hi all,

I am able to get alert for above EMA cross but it is giving alotttt of repeated alerts. How can reduce it to just 2 alerts for per ema cross ? Please help !!!
Ignored
Bundy's status today: "Waiting..."
 
 
  • Post #17
  • Quote
  • Jun 18, 2006 6:20am Jun 18, 2006 6:20am
  •  bundyraider
  • Joined Feb 2006 | Status: 'Try-hard' extraordinaire... | 2,151 Posts
Since the Start() routine is called every tick, you may still get mutiple alerts if the current bar oscillates around the cross-over trigger values.

For me, I'd still be keen to test the previous bar for the crossover and ignore the current "working" bar. On average I would think this wouldn't lower potential profits significantly. It maybe more important to keep false/premature alerts at bay.

...Or check the previous bar , but make tentative decisions in the working bar. i.e. if the EMA has moved more than a certain pip count past the cross.

All's fun playing.

Cheers,
Bundy
Bundy's status today: "Waiting..."
 
 
  • Post #18
  • Quote
  • Jun 18, 2006 6:26am Jun 18, 2006 6:26am
  •  bundyraider
  • Joined Feb 2006 | Status: 'Try-hard' extraordinaire... | 2,151 Posts
Quoting trucco
Disliked
Somebody know how into mt4 is the Stochastic and RSI level indicated ?
I mean, which object/variable, returns me the current RSI or Stochastic ?
Cheers
Ignored
In the MetaEditor, if you have the Navigator window open you'll find the built in indicator fiunctions in the MQL4 Reference. In the dictionary section, under Technical Indicators.

iStochastic() & iRSI() be what ya need.
Bundy's status today: "Waiting..."
 
 
  • Post #19
  • Quote
  • Jun 18, 2006 7:54am Jun 18, 2006 7:54am
  •  trucco
  • | Joined May 2006 | Status: Member | 636 Posts
Quoting bundyraider
Disliked
In the MetaEditor, if you have the Navigator window open you'll find the built in indicator fiunctions in the MQL4 Reference. In the dictionary section, under Technical Indicators.

iStochastic() & iRSI() be what ya need.
Ignored
Hi bundyraider,

thanks for hint.
I tryed already, works, just its funny cause my broker indicators (rsi and stoch slow) with same configurarion, have different values on metatrader...., so I cant apply an alert system because with metatrader im complitly lost in the signal he gives me! i guess the price moves much more with metatrader..and this is confusing. I prefer brokers which put a kind of price fiilters in their system to have it a bit more smooth

Thanks!
 
 
  • Post #20
  • Quote
  • Jun 18, 2006 10:19am Jun 18, 2006 10:19am
  •  compro99
  • | Joined Aug 2004 | Status: Member | 481 Posts
Quoting bundyraider
Disliked
Try these changes dude.

All additions in coloured text. Nothing has been removed.

I haven't tested this, but should be straight forward. Should put you on the right path at least. Probably don't need to check previous MAs now either. LOL.
Ignored

Hi bundyraider,

I got some compile errors. How can i resolve it ? It seems like the changes are not recognisable variables.
The future depends on what we do in the present.
 
 
  • Platform Tech
  • /
  • EMA crossover Email Alert
  • Reply to Thread
    • Page 1 234 5
    • Page 1 234 5
0 traders viewing now
  • More
Top of Page
  • Facebook
  • Twitter
About FF
  • Mission
  • Products
  • User Guide
  • Media Kit
  • Blog
  • Contact
FF Products
  • Forums
  • Trades
  • Calendar
  • News
  • Market
  • Brokers
  • Trade Explorer
FF Website
  • Homepage
  • Search
  • Members
  • Report a Bug
Follow FF
  • Facebook
  • Twitter

FF Sister Sites:

  • Metals Mine
  • Energy EXCH
  • Crypto Craft

Forex Factory® is a brand of Fair Economy, Inc.

Terms of Service / ©2022