You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
Although it still can be done using array of ma (ma[]) but this one is easier.
Your code should be like this
It's very simple, you can do it by yourself after this.
It works great, I appreciate your help.
Now I would like to add a sendmail( ) function or trigger an alert when this indicator goes above or below a given value.
I don't know where to place it, or how to write the condition for the value filter
Also how do I add a arrow or mark on the chart when it reaches the given value
Thanks
I have managed to add levels, but how to I set an alert or sendmail when the level has been crossed.
thanks
If you feel like hinting me instead of helping, just tell me what functions to use, I know it is supposed to look something like this
if ??????????? > 10 ()sendmail blah blah blah
but where do i put it does it need separate brackets and what am i calling on?
thanks for all
I've never code any sendmail feature before, so don't ask me about the rest.
Hope this helps.
This is what I now have,
Considering that I need this indicator for both directions (long/short), I want it to be triggered by a value of > 10 or <-10 because the -10 is the same indicator for a downwards trend,
Does this make any sense?
My 2nd question is how to reverse it to send an alert when it is back below or above this level,
I also noticed a strange comment in the Journal "Mail: not enough space for 'Spread Changed'" I hope this has nothing to do with the code,
It now appears that the message is being sent repeatedly maybe this is cloging the mail queue, see this link https://www.mql5.com/en/forum/46481
so it will make more sense to only have the message sent one time when it crosses the levels in either direction, and a message when it crosses back.
Thanks for your time.
a) It was the MAIL problem mentioned in the above link about an over flooded queue in the outbox.
b) I received 42 messages in 1 minute.
thanks