Script to capture objects in chart

 

Hello everyone!

I am wanting to make a script that reads all the objects of the rectangle type in the chart, after which check which ones have a certain word in the name, the ones that have them, store their OBJPROP_PRICE1 in an array. Does anyone help me do?


I found this code in the forum, but is to delete objects, help me adapt?


Thank you very much!


string Search = "Retail"; // This is the object name you want to remove
int TotalObject;
TotalObject = ObjectsTotal(0,0,-1);

for(int i =TotalObject; i >=0 ; i--) {}
{
if (StringFind(ObjectName(0,i,0,-1),Search,0)>0) ObjectDelete(0,ObjectName(0,i,0,-1));

}

 
Danillo Souza:

Hello everyone!

I am wanting to make a script that reads all the objects of the rectangle type in the chart, after which check which ones have a certain word in the name, the ones that have them, store their OBJPROP_PRICE1 in an array. Does anyone help me do?


I found this code in the forum, but is to delete objects, help me adapt?


Thank you very much!



Files: