if the chart is fresh, then the number get higher and higher as objects are created, but if the chart is old/reopened (I do not know when exactly) the numbers of the newly created objects may be lower than the current highest number.
So 2) is not exactly correct ...
Does anybody know how the last created object can be identified at anytime working with the chart?
I've never had reason to use it, but you could loop through the objects and find the last using
OBJPROP_CREATETIME
In the same kind of idea, is there a function to undo "ObjectDeleteAll" (called by delete button and called by undo button) ?

ObjectsDeleteAll - Object Functions - MQL4 Reference
- docs.mql4.com
[in] Prefix in object names. All objects whose names start with this set of characters will be removed from chart. You can specify prefix as 'name' or 'name*' both variants will work the same. If an empty string is specified as the prefix, objects with all possible names will be removed. Indexing of chart subwindows (if a chart has...

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
How can I undo creating an object (HL, VL, Trendline) after pressing a button to create it? (not by calling ObjectCreate, so I do not have the object name)
My current thoughts and questions:
Thank you!