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
I haven't investigated it deeply, now I'm talking logic:
- I have a check before starting to build an indicator in OnCalculate - whether all indicators that are required for the correct building of this indicator have been built. If not - exit from the loop, because you cannot wait in the same run OnCalculate (that you cannot wait - confirmed by Renate) from this it follows that this indicator should exit the loop and wait again for update, right? and if there are several levels of nesting, then how many times should the user call this option from the chart menu, it is assuming that every time indicators between
- the fact that in the indicators called through iCustom, OnTimer and OnChartEvent do not work is also a fact confirmed by the moderators in the next thread and I have checked it myself.
I haven't investigated it deeply, now I'm speaking logically:
- i have a check before starting to build an indicator in OnCalculate - if all the indicators that are required for the correct construction of this indicator have been built. if not - exit the loop, because you cannot wait in the same session OnCalculate (that you cannot wait - confirmed by Renate) it means that this indicator should exit the loop and wait again for updates, right? and if there are several such nesting levels, then the user will need to call this option from the chart menu every time, it is assumed that every indicator between neighbour
- it is also a fact that in the indicators called through iCustom, OnTimer and OnChartEvent do not work - it was confirmed by the moderators in the next thread and I have checked it myself.
OK, how did you solve the problem of such constructions?
I had a set of interconnected complex indicators in MT4, which needed to be transferred to MT5. I decided to make a class system to include indicators into each other and calculate them both without iCustom and without indicator buffers.
Radically. And what about adding the access to the timer to nested indicators?
I didn't ask about such plans, because there was no possibility to wait anyway.
In such a case they would add the possibility to wait for Sleep() type in indicators, so that one could wait for the data to be created without exiting OnCalculate, like in the scripts. By the way, it concerns timeseries as well - the indicator will not be able to load the necessary data without arrival of new ticks.
I didn't ask about such plans, because there is no possibility to wait anyway.
In such a case we should add the possibility to wait for Sleep() type in indicators, so that one can wait for the data to be created without exiting OnCalculate, like in the scripts. By the way, it concerns timeseries as well - the indicator won't be able to load the necessary data without new ticks coming.
And this, as I understand it, cannot be solved even by embedding each other - at weekends, if you don't want to click on Refresh, you have to first load the history for all the necessary pairs/FTs with the script, and only then run the indicator.
Sleep() is useless to ask for - one thread for all indicators. And this system is unlikely to be redesigned. And if we implement the timer, there will be no need in the slip.
An idea has just occurred to me. What if we implement the following. How to inform the main indicator about the data we want to receive, receive this data from the timer and then calculate all attached indicators?