unreleased indicator handle causing data problems , probably

 

Let me preface this with the following : this might not be a terminal issue but it looks like a terminal issue.

  • The code is creating a lot of objects and has 2 indicators embedded in the EA.
  • 1 indicator is used normally the other is a workaround for the following.
  • On deinit the terminal has no time to erase all the objects (ObjectsDeleteAll)
  • And it also has no time to remove the indicator (IndicatorRelease)
  • And i can't delete the indicator either
  • The workaround is a cleaner indicator , but it does not solve for the leftover handles 
  • if i poll for an error calling ChartIndicatorDelete it returns 4022

The problem : if i remove the EA and then attach it again (even in a new chart):

  • indicator 1 cannot receive data anymore , it's handle loads but it cannot copy buffers
  • timeframes with unloaded data stay in the loading state with the big text in the middle and do not receive data
  • it does not matter if i close the chart and open a new one , same behavior
  • mt5 must be restarted for things to function again

It appears to be affecting the strategy tester charts too 

I cannot share the code here , i can send it to a mod/admin if they want to verify.

thanks

[i compile it with the cloud compiler although i don't think that is a factor]

 
You can use Sleep() to give time for each functions to execute. 
 
Sander Maehle Andresen #:
You can use Sleep() to give time for each functions to execute. 

i will try that and report back , thanks

 
Like Sleep(100) before each function call in OnDenit 
 
Sander Maehle Andresen #:
Like Sleep(100) before each function call in OnDenit 

will the terminal wait ? that is the current issue from what i understand that the terminal will not wait until deinit completes

 
Sander Maehle Andresen #:
Like Sleep(100) before each function call in OnDenit 

okay i still need the cleaner indicator but it solves the data access problem , thanks

so it could be something else im doing 
 
Okay. You can also try this. Like cleanup if IsStopped.