StringFind() not working for some reason , is this a possible bug?

 

Hello 

I am trying to read the text from the chart but there is something wrong 

The Arrow indicator draw arrows and also draw a text on the candle which has the arrow , i am trying to read that text on the arrow candle but i have been struggling for last 3 hours and couldn't get it to work for some  reason

here is my code: 

   for(int v=0; v<=500; v++)
     {
 
      if(iCustom(Symbol(),PERIOD_CURRENT,"Arrow",0,v)!= EMPTY_VALUE
         || iCustom(Symbol(),PERIOD_CURRENT,"Arrow",1,v)!= EMPTY_VALUE)
        {
         string objName = ObjectName(v); 
         Print(v); //This prints all the candle IDs where the indicator is visible , (so there is no issue till this point)
         if(StringFind(objName,"DFS#",0)!=-1)
           {
           Print(objName); //This only prints 6-8 names of the object which has "DFS#" in the name whereas there are more than 100 objects which has "DFS#" in their names
            string tempval= objName;
            string temtext= ObjectGetString(0,objName,OBJPROP_TEXT);
 

           }
        }

     }
 

can someone please point out what am I doing wrong here ?

because in past i have done it exactly like this and it always worked but not working anymore

 
Two things stand out to me.

First, you are only inspecting the first 500 candles. (Newest to oldest)

Second, the indicator might not be fully populated jet.
 
Dominik Egert #:
Second, the indicator might not be fully populated jet.

yep this was the issue , i put few seconds wait before reading the buffers and text and it all worked out