I don't know what has changed or even if something has changed, not sure exactly. But you are totally right, working with complex indicators, multi-symbols and/or multi-timeframes is a complex matter if you want it to work in all cases (in normal conditions, when changing TF, on week-end when there is no ticks, when starting/restarting MT5, after computer sleeping, etc...). If you need to use several indicators (one calling an other, etc...) it just becomes a hell.
For example if you need to use this MA_Test indicator within an other indicator or EA with iCustom(), it will not work correctly because
OnTimer() even is not triggered.
I managed it with a bunch of custom solutions, it works but with some mandatory compromises. It is still in testing as some "special cases"
are not easy to manage. So, in summary, it's possible to do but far from easy, and I can't provide a comprehensive solution as my code is
private. I sympathize.

- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Hi,
since the latest build of MT5, the background calculation of indicators, such as iMA() in MT5 seem to be changed. Result is, that it seems you have to deal with luck to get the values, especially when you request them within OnTimer() ... at it least this is what I suspect. When I drag such an (complex) indicator on a chart and switch between timeframes, sometimes it shows the results, sometimes not. Just like that, and this is useless. The only reason is to calculate the indicators manually by avoiding the iMA() function at all.
Till now, I used some code which manages the indicator-handles that are returned by such functions, to avoid a creation of duplicate indicators. You can find a similar sample code below. It works without problems, also with the latest build. BUT ... as soon as your calculations in the indicator or expert get complex and need more time, the indicators aren´t calculated anymore, or maybe they are, but not always when you need the results. This method with this background calculation is absolutely horrible and a pretty bad idea. I don't understand it at all and I am sure I am not the only one. In a code, no matter if its and indicator or EA I need the data when I ask for it and not when there was some free time to calculate it. BarsCalulated(handle) ... really?
So my question is: Is there a class-library which contains all or most indicators and which delivers results on demand?
Thank you for your input guys.