Hi everyone
I have written an expert that runs custom macdonrsi indicator on 3500 Renko charts with different size candles. In the end, when I want to delete the expert or change the profile, it automatically tries to close all these indicator handles at once, and that's why it hangs and I have to close Metatrader and open it again.
I tried to manually release the handles one by one inside the OnDeinit function.
My code:
Later, I tried to slow down the process by using the sleep function, but it didn't help :
Can you help me to solve this problem?
Can anyone help me?
OnDeinit only has a limited amount of time to process, after which it will be forcefully terminated. given that you say you are dealing with 3500 indicators it is likely that it is running out of time.
Slowing it down will only make it worse not better.
If it is causing your terminal to hang then maybe you need to scale back, and no you cannot extend the time.
OnDeinit only has a limited amount of time to process, after which it will be forcefully terminated. given that you say you are dealing with 3500 indicators it is likely that it is running out of time.
Slowing it down will only make it worse not better.
If it is causing your terminal to hang then maybe you need to scale back, and no you cannot extend the time.
you could use OnChartEvent to release all the handles when a specific key is pressed or key combination
assigning a custom hotkey to perform an action is a simple task:
https://www.mql5.com/en/code/50353

- www.mql5.com

- 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 everyone
I have written an expert that runs custom macdonrsi indicator on 3500 Renko charts with different size candles. In the end, when I want to delete the expert or change the profile, it automatically tries to close all these indicator handles at once, and that's why it hangs and I have to close Metatrader and open it again.
I tried to manually release the handles one by one inside the OnDeinit function.
My code:
Later, I tried to slow down the process by using the sleep function, but it didn't help :