@mladen: Great, thank you very much! Much better than before. But one question: I saw that you added the condition i==0 before an alert should be displayed. Why isn't it enough to check lastAlertAt=!Time ? It would be very helpful for my mql4-learning if you explained that.
Thanks for the explaination! I will try to pull it out of the main loop and make some further experiments...
Mladen-could not help me with my question m from the post 4142; Thanks in advance! Sorry for my english ...
Here is a post which explains why I do no make alerts for recalculating and / or repainting indicators : https://www.mql5.com/en/forum/180648/page273
SSA is recalculating
Adding alerts on a repainting or recalculating indicator is like riding on a train without brakes : you get a "signal" and then it is changed, and again, and again ... and in the mean time you entered the position based on a "signal"
Even if it is a correctly coded recalculating indicator (not a wrongly coded repainting indicator) they should, in my opinion, always be used in an estimation mode, never in signaling mode (so not even in "alerting" mode) otherwise, whoever does that is playing a very dangerous game
You want to check for alerts only once primarily because of the speed but also because to avoid repeated alert (just remember that Time will change for a new bar). That whole code can even be pulled out the loop completely (I usually do that, didn't do it in this case to keep it similar to your code) and I think that it is even better that way : when it is out of your main loop it will always be executed only once per tick and you can strictlu control what do you wish to do at that "once per tick" occasion
Mladen thanks for answer! Readings from H4 to M15 also can be done?
can u make this indi mq4?
and alert.. Thanks!
Dear Mladen not refuse a request! It is necessary that the reading from H4 to appear on the M15! It is very necessary! Thanks in advance!
Did you read the post I am referring to at all?
If not please read it. Here is the link to that post again : https://www.mql5.com/en/forum/180648/page273
all the best
Please enable the necessary setting in your browser, otherwise you will not be able to log in.