Forex Factory
  • Login

  • Username: Password:
  • 3:43pm

  • Search
  • Home

  • Forums

  • Trades

  • Calendar

  • News

  • Market

  • Brokers

Options

Search
Search
Search

Subscribe to Thread

Bookmark Thread

First Page First Unread Last Page Last Post

Printable Version

Similar Threads

Special EMA Crossover Indicator with alert needed 3 replies

Price / Ema 21 Crossover Audio Alert 6 replies

EMA 10 / LWMA33 Crossover Alert Needed 6 replies

HELP: EMA crossover with arrow but no e-mail alert 2 replies

EMA 84 Crossover Alert 1 reply

  • Platform Tech
  • /
  • Reply to Thread
  • 8

EMA crossover Email Alert

  • Last Post
  • First Unread
  •  
  • Page 1 234 5
  •  
  • Post# 1
  • Quote
  • First Post: Jun 9, 2006 12:06am
  • compro99
    Joined Aug 2004 | 444 Posts | Status: Member
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
  • trucco
    Joined May 2006 | 629 Posts | Status: Member
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
  • trucco
    Joined May 2006 | 629 Posts | Status: Member
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
  • trucco
    Joined May 2006 | 629 Posts | Status: Member
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
  • dof
    Joined Mar 2006 | 457 Posts | Status: Member
Quoting compro99
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.
I made one, see if it's good.
Attached File
File Type: mq4 EmaCross.mq4   2 KB | 2,227 downloads
Try hard, think fast, die young
  • Post# 6
  • Quote
  • Jun 9, 2006 7:31am
  • bundyraider
    Joined Feb 2006 | 2,126 Posts | Status: 'Try-hard' extraordinaire...
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... :smug: "
  • Post# 7
  • Quote
  • Jun 9, 2006 7:37am
  • trucco
    Joined May 2006 | 629 Posts | Status: Member
Quoting bundyraider
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" );
nice one
I didnt know
Thanks
  • Post# 8
  • Quote
  • Jun 9, 2006 7:38am
  • trucco
    Joined May 2006 | 629 Posts | Status: Member
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
  • twoblink
    Joined May 2006 | 809 Posts | Status: Member
That's so awesome..

All you need to do is:
Alarm -> Email -> PDA and you've got a mobile trading system
google: "Trend and Trendfans"
  • Post# 10
  • Quote
  • Jun 9, 2006 2:00pm
  • compro99
    Joined Aug 2004 | 444 Posts | Status: Member
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,029 download
The future depends on what we do in the present.
  • Post# 11
  • Quote
  • Jun 9, 2006 10:01pm
  • bundyraider
    Joined Feb 2006 | 2,126 Posts | Status: 'Try-hard' extraordinaire...
Quoting compro99
DOF, thanks.

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

Anyone can help to reduce the alert ?
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... :smug: "
  • Post# 12
  • Quote
  • Jun 9, 2006 10:09pm | Edited at 10:18pm
  • bundyraider
    Joined Feb 2006 | 2,126 Posts | Status: 'Try-hard' extraordinaire...
Quoting twoblink
That's so awesome..

All you need to do is:
Alarm -> Email -> PDA and you've got a mobile trading system
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... :smug: "
  • Post# 13
  • Quote
  • Jun 13, 2006 6:12am
  • trucco
    Joined May 2006 | 629 Posts | Status: Member
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
  • trucco
    Joined May 2006 | 629 Posts | Status: Member
Quoting trucco
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

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
  • compro99
    Joined Aug 2004 | 444 Posts | Status: Member
//---- input parameters
extern int FastEMA=3;
extern int SlowEMA=34;
extern int SlowEM2=89;

double FASTEMACURRENT,FASTEMAPREVIOUS,SLOW EMACURRENT,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,MOD E_EMA,PRICE_CLOSE,1);
SLOWEMACURRENT2=iMA(NULL,0,89,0,MOD E_EMA,PRICE_CLOSE,0);
SLOWEMAPREVIOUS2=iMA(NULL,0,89,0,MO DE_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
  • bundyraider
    Joined Feb 2006 | 2,126 Posts | Status: 'Try-hard' extraordinaire...
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
// 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,SLOW EMACURRENT,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,MOD E_EMA,PRICE_CLOSE,1);
SLOWEMACURRENT2=iMA(NULL,0,89,0,MOD E_EMA,PRICE_CLOSE,0);
SLOWEMAPREVIOUS2=iMA(NULL,0,89,0,MO DE_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 !!!
Bundy's status today: "Waiting... :smug: "
  • Post# 17
  • Quote
  • Jun 18, 2006 6:20am
  • bundyraider
    Joined Feb 2006 | 2,126 Posts | Status: 'Try-hard' extraordinaire...
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... :smug: "
  • Post# 18
  • Quote
  • Jun 18, 2006 6:26am
  • bundyraider
    Joined Feb 2006 | 2,126 Posts | Status: 'Try-hard' extraordinaire...
Quoting trucco
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
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... :smug: "
  • Post# 19
  • Quote
  • Jun 18, 2006 7:54am
  • trucco
    Joined May 2006 | 629 Posts | Status: Member
Quoting bundyraider
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.
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
  • compro99
    Joined Aug 2004 | 444 Posts | Status: Member
Quoting bundyraider
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.

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.
Thread Tools Search this Thread
Show Printable Version Show Printable Version
Email This Thread Email This Thread
Search this Thread:

Advanced Search

  • Platform Tech
  • /
  • EMA crossover Email Alert
  • Reply to Thread
    • Page 1 234 5
0 traders viewing now
  • More

©2013 Forex Factory, Inc. / Terms of Use / Privacy Policy

Forex Factory® is a registered trademark.

Connect

  • Facebook
  • Twitter
  • RSS

Company

  • About FF
  • FF Blog
  • Careers at FF
  • Advertising
  • Contact FF

Products

  • Forums
  • Trades
  • Calendar
  • News
  • Market
  • Brokers
  • Trade Explorer

Website

  • Homepage
  • Search
  • User Guide
  • Member List
  • Online Now
  • Report a Bug