This could be semantic rather than a bug.
The purpose of ObjectDelete is to "remove the object with the specified name".
At the end of running the function, is there an object called "Non-existing Object" still on the chart? No... so is this success?
Looking at it another way, did ObjectDelete remove an object called "Non-existing Object"? No... so is this failure?
Do you measure success by the outcome or the action taken?
Perhaps a false would be expected if the named object remains on the chart after running the function. Otherwise, it was a success.
Just tried to report it on the Service Desk and it is not accepting my message, saying "Error saving data".
Tried it also from a different location, PC and browser (using my VPS) and the same happened.
Were you able to report it on your end?
Agreed. I'm just curious which one "they" will say is correct :-)
Personally, I think it is better to return true. Otherwise, you need to add extra code to check the object exists else put up with 4202 errors.
In my opinion, in both cases one needs to check for the existence of the object before deleting, irrespective of which version is "correct".
EDIT: However, I hope they "fix" it so that it will work in the same manner as MQL4. Otherwise there will be yet another difference in functionality in which we will need to place conditional compilation in code made to compile on both versions.
Interesting! Why would you need to check it exists if you want it gone?
The time taken to check if a non-existent object exists is largely comparable to attempting to delete a non-existent object on MT4 (and a cursory inspection on MT5 shows it is substantially slower), so I can't see any tangible performance benefit by running the check. But it will add more lines to your code.
When you want to detect if the user accidentally deleted it and needs to be recreated. I meant this as general "housekeeping" and not for a single once only delete functionality.
But yes, I agree, for a "OnDeinit()" functionality, there is no need to test it first.
Ah I see.
As a side note:
Running it on MT4, there is not much in it.
Running it on MT5, it is over 50 times slower.
Does anyone have any insight into why?
As a side note: