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
Delays are just a consequence of optimisation. The first delay during initialisation. If the indicator (in the MT4 video) is set to a certain timeframe of the symbol, for which there is no history, or it is not complete, then the diagrams on the history may not be built, or will be built with errors. And I have observed this phenomenon. Please note that the indicator can be set on one timeframe, take the initial data from another, and show for the third. In order to draw charts on the history only once and immediately without errors, a piece of code is added to OnCalculate, which checks the readiness of the source data, and then skips five more calls of OnCalculate to ensure that now all the source data are ready. So that the user doesn't think that the indicator is hanging, the log shows the messages pass 1 .... pass 2, etc. As you can see, there is no recalculation, the load on the terminal is minimal. In the end, only the last diagram is recalculated. It happens once a minute. Is it a bad way? Maybe. But nothing cooler has come to my mind.
The second time the delay occurs in the mode when chart primitives are controlled by the indicator and not by the terminal. This is done to handle the occurrence of multiple CHARTEVENT_CHART_CHANGE events. I.e. when the user starts pulling the chart back and forth out of the blue. If we try to process such events as they come, the indicator will not be able to cope with constructions and will get a mess. That's why the indicator simply does nothing and returns control when the event occurs. But when the user stops generating an event, the indicator waits for three seconds to make sure that there will be no new events and only then redraws the diagrams in a new place. Only once! Yes, we get a delay. But we warn about it honestly, we do not consume unnecessary resources, and when there are questions, we explain our position. As it happens now )
Both the first and the second case are not necessary to manifest. And for myself I would not do these checks. But for others I have to. If I find, or someone suggests a better way, I will immediately start corrections.
Мне действительно понравилось это, но я не мог заставить это работать.