I can help you with this. Let me know what the conditions would be for an alert to occur.
I would need to receive an email alert when price crosses the 13 day sma in either direction. Not when the next candle ends, but when price actually crosses the sma by one pip. I really appreciate your help.
Is there any other info. you require?
No, that should be all I need. I will get this done ASAP.
I took a look at the indicator. The alerts already happen in real-time except for when the indicator is first started. The thing that I am not sure about is the crossing definition. The indicator is not coded to alert specifically on a cross. It simply alerts when the current price meets or exceeds the MA line a certain amount. And it alternates alerts. For example, if the last alert was a buy alert then the next alert can only be a sell alert. And so on. So based on this definition, you will get alerts when there is no actual cross. I can send an example if you want. So did you want the current alert feature to remain intact and a NEW email alert feature with it's own definition added? Or do you want all alerts to be the same and occur at the same time? Hope you understand what I am saying.
Actual crossing it not necessary. As long as I can receive an email alert when price hits the MA exactly, or passes it by no more than one pip.
Regarding the second issue of alternating alerts, it seems to me that for price to cross the MA in one direction, it has to cross in the opposite direction before it can come back again. As an example, if it crosses up, it has to cross down before it can cross up again. So I don't see a problem with alternating alerts, unless I'm missing something.
I am using the point where price meets the MA as an entry and exit point, in conjunction with candlestick patterns, but have to sleep some time. So I plan to leave my smart phone on all night in case an alert comes in. Hopefully this will catch some good entries, and save me some money when exits come in the middle of the night that I otherwise would not see until the next morning.
Thank you again for your help. I really appreciate it.
About the alternating alerts, I said this because it is mainly an issue only if the 'Crossed_Pips' is used. For example, let's say a candle opened above an MA line but then dipped below the MA line by X pips and sell alert occurs. Then before the candle closes, the candle retraces back up above the MA line but not enough for a buy alert to occur. Then the next candle opens above the MA line. Then the candle moves up some and a buy alert occurs. The buy alert would go off even though there was no cross on that candle. The cross would actually have happened on the previous candle. It is situations like this that I would say the alternating alerts and the crossing feature do not meet your requirements.
Anyways, if all you want is alerts whenever an MA line is touched, it would be easier to just code an indicator from scratch. I might even have one in my archive. Modifying this indicator would take more time. There is one thing that still needs mentioned though. Let's say the price hits the MA line going upwards and then price retraces down a few pips. Then back up a few pips. And so on. You would want to receive multiple alerts when price moves up and down over the MA line, right?
Yes, all I need is to know is when the MA line is touched in either direction. And yes, I would want to receive multiple alerts whenever this occurs. So if it would be easier to code a new indicator, or if you already have one, that would be fine.
Also, just a few questions:
1. Would I be able to set different period MA's?
2. Would it be usable on any timeframe?
3. Will the alert show the currency pair the alert is for?
Hi. Ok, sure. About your questions:
1)Yes
2)Yes
3)Yes
One more question. Did you want the indicator to display the MA line too or do you only care about receiving the alerts?
Yes, I would prefer to have the indicator display the MA line in addition to the alerts.
Attached is your indicator. The indicator will alert whenever the MA line is touched or exceeded. It alerts in real-time too. So you may get many alerts. For anyone reading this, this is not a bug, but is how it was intentionally made to work. For the email and mobile alerts, you will need to input your settings in the MT4 terminal in the 'Tools-Options' section. Hope you like it.
![MQL5 - Language of trade strategies built-in the MetaTrader 5 client terminal](https://c.mql5.com/i/registerlandings/logo-2.png)
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
I was wondering if anyone could help me by coding an email alert into the attached indicator. It would be greatly appriciated.