You are reading the list from the bottom up.
Thank you for your reply.
Yes, since it was originally displaying in reverse order, that is not a problem.
I also asked the same question on a Japanese forum, and another person informed me that ObjectName() is designed to display object names in sequence for each type of object, and to meet my intention, I would need to prepare a separate array to process it.
Because using ObjectName() alone does not allow you to obtain the list of object names in the order they were created.
Pressing the Backspace key allows you to delete the created objects in reverse order.
I want to handle this order of objects in mql5.
Since I thought it would be disrespectful not to try your suggestion,
I read the list from top to down, but the terminal display still did not show the objects in the order they were created.(Attached file, screen2.png)
void OnStart() { Print("---------------------"); int num = ObjectsTotal(0, -1, -1); for (int i = num - 1; i >= 0; i--) { Print(ObjectName(0, i, -1, -1)); } }

- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Problem
ObjectName() does not work as per the object list index.
I wrote a script to display the names of all objects on the chart in the new order on the terminal, referring to the documentation of ObjectName(), but it does not work in the order of the object list.
What I want to do
I want to know how to get ObjectName() to return object names that correspond to the order of the object list.
What I did
Codes
Solution
A screenshot (screen.png) is also attached.
Please let me know your guidance. Thank you for your assistance.