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
Do a Print at the beginning of OnDeinit and after closing the client terminal, look at the Expert log and make sure that OnDeinit has been called!
Here is your error
You clearly know the objects you have created yourself.
Keep their names and delete them without reference to ObjectsTotal and ObjectName
PS the new build has added a function to delete a group of objects by prefix. It will help you if you name your objects using the same unique prefix in their name
Do Print at the beginning of OnDeinit and after closing the client terminal, look at the EA log and make sure that OnDeinit was called!
Here is your mistake
You clearly know the objects you created yourself.
Save their names and delete them without reference to ObjectsTotal and ObjectName
PS The new build has added a function to delete a group of objects by prefix. It will help you if you name your objects using the same unique prefix in their name
Actually, deinit in all programs is called when the terminal is closed.
There is even a special code for the cause of deinitialisation. REASON_CLOSE
And does it reset the indicator buffers or not?
And does it reset the indicator buffers or not?
The situation with your indicator has been solved.
Here's the thing - the indicator is calculated not only on the ticks arrival, but also on the first drawing and on the missing history arrival.
1. A new tick arrives - the indicator is calculated.
2. The missing history arrives, which plugs the hole between the last data from the last terminal start and the last tick. The indicator is calculated. But at the same time there is no new bar condition!
To solve this problem you need to check the number of bars. Approximately like this
Stuck the buffer initialisation block with an empty value in both init and deinit. The result is the same. I.e. it does not exist.
Waiting for developers comments.
Everything resets to zero. After all, the terminal closes )))
Hmm. The buffer initialization block EMPTY_VALUE is put in Inite.
Why? Inite buffers may not yet be allocated.
What about when the buffer is heavily buffered (a new batch of historical data has arrived)?
In such cases, the initialization of the buffers is done before the indicator calculation, when it's clear that the whole indicator will be recalculated
Why? Inite buffers may not yet be allocated.
And what about when the buffer is very big (a new batch of historical data came)?
In such cases, initialization of buffers is done before the calculation of the indicator, when it is clear that the entire indicator will be recalculated