ObjectsDeleteAll issue on MT5 for MAC

 

why this is working for mt5 on mac↓

ObjectsDeleteAll(ChartID(), IndiName);

but this does not work↓

ObjectsDeleteAll(ChartID(), IndiName, -1, -1);


IndiName is a prefix for all objects in my indicator.

 
Mahdi Ebrahimzadeh: ObjectsDeleteAll

You have not provided sufficient information to formulate an answer.

Show example code, with error checking, that can reproduce the issue as well as log output, and if possible, screenshots to demonstrate the issue.

 

this is working, means it deletes all objects that indicator generated when detach indicator from chart

//+------------------------------------------------------------------+
void OnDeinit(const int reason)
{
   if (reason == 1 || reason ==4) 
      {
      ObjectsDeleteAll(ChartID(), IndiName);
      GlobalVariableDel(IndiName + Symbol() + "LastCSVDate");
      EventKillTimer();
      }
   
   ChartRedraw();   
}

this is not working, means when detaching indicator from chart it does not delete all objects created by indicator.

//+------------------------------------------------------------------+
void OnDeinit(const int reason)
{
   if (reason == 1 || reason ==4) 
      {
      ObjectsDeleteAll(ChartID(), IndiName,  -1, -1);
      GlobalVariableDel(IndiName + Symbol() + "LastCSVDate");
      EventKillTimer();
      }

   ChartRedraw();   
}

- Note1: I am sure all objects has IndiName (a string) as prefix.

- Note2: There is not any Error on journal section of indicator during detaching it. The only message: custom indicator ... removed.

Files:
 
Mahdi Ebrahimzadeh #:

this is working, means it deletes all objects that indicator generated when detach indicator from chart

this is not working, means when detaching indicator from chart it does not delete all objects created by indicator.

- Note1: I am sure all objects has IndiName (a string) as prefix.

- Note2: There is not any Error on journal section of indicator during detaching it. The only message: custom indicator ... removed.

Obviously if you don't do any error checking and report it to the Experts logs, there will not be any! You are not even checking the return value of the ObjectsDeleteAll() function.

Your code is also not reproducible. Provide sample code that is self contained and creates the objects and tries to delete them, so that it ca been run by users to verify your claim.