Need indicator for SMA

 

Hi,

I've been all over the web looking for an indicator for the Simple Moving Average that does the following:

1. Alerts via sound and email when the PRICE crosses the SMA line

2. Can be used for the 100 and 200 SMA on the same chart

2. Can be used with any time frame

Help is truly appreciated!

MT

 
Here. You can also do a google search for "mql4.com moving average alerts" for more.
 
ubzen:
Here. You can also do a google search for "mql4.com moving average alerts" for more.

Thanks so much! Is there a way to make it send an email as well? I did the search you suggested and it is very overwhelming.
 
Yeah, but that'll require some work on your part. You'll need to edit the code and right next to the line that says Alert(), add one that says SendMail(). You need to have your email set-up correctly and that can be a process in itself (depending on your experience). Sorry, I don't know of any which have Alert and SendMail(). Good-Luck.
 
Okay. I do have the email in the regular MT4 alert function set-up, and it works just fine. Is it much more than that? (Obviously, you are dealing with a novice:) Once again, thanks!
 
Under Tools>Options>Email Tab. Fill up all the information. If you're saying you've already done that then you can test it and go from there.
 
ubzen:
Under Tools>Options>Email Tab. Fill up all the information. If you're saying you've already done that then you can test it and go from there.

Got it.
 
ubzen:
Under Tools>Options>Email Tab. Fill up all the information. If you're saying you've already done that then you can test it and go from there.

ubzen, I can't get it to work right. The visual and sound alerts are all over the place. I went with the default settings and tried different time frames. Please see the attached 5 min EURUSD chart with 100sma and 200sma.
 

I've not seen any of the code you might be using, but will add the following caution ...

.. any "alert when price crosses line" is prone to repeated triggering as price jumps up & down, above & below the MA (or other) line, unless you either add some hysteresis or timing conditions

 
brewmanz:

I've not seen any of the code you might be using, but will add the following caution ...

.. any "alert when price crosses line" is prone to repeated triggering as price jumps up & down, above & below the MA (or other) line, unless you either add some hysteresis or timing conditions


Brewmanz, thanks...I'm learning. So where can I find an indicator that does the items below? Is there one out there or do I need to pay someone to write it? I'm not sure I have the aptitude to learn the code and write it myself. I can make small modifications, but that's about it.

1. Alerts via sound and email when the PRICE crosses the SMA line

2. Can be used for the 100 and 200 SMA on the same chart

3. Can be used with any time frame

4. Uses a popup window to indicate which chart

 

I think within 2 or 3 hours of reading you are able to write it yourself. Fortunately mql makes sending emails and alert very easy.

Why don't start? I am sure i and other will help you if you have any specific issue.

1) Get the values from the MA, (maybe the hardest part)

2) compare the values and save the current state.

3) when current state not matches the previous state -> ring the bells.

You can copy these three lines in your next post and fill in the code needed to do these things, step by step.

//z

Reason: