How can I determine which candle an arrow object is drawn on

 

I am using the following code to draw an arrow, how can I tell which candle the arrow object is drawn on?


void OnTick()
  {
   
   for(int i = 0; i < ObjectsTotal(); i++){

      string name = ObjectName(i);

      if(ObjectType(name) == OBJ_ARROW){

         if(ObjectGet(name, OBJPROP_COLOR) == Red){

            Print("RED ARROW FOUND");

            }

         }
   }
   
  }
 
  1. Don't double post! You already had this thread open.
              General rules and best pratices of the Forum. - General - MQL5 programming forum

  2. Jackery: I am using the following code to draw an arrow, how can I tell which candle the arrow object is drawn on?
    That code does not "draw an arrow." It sees if a red arrow (of some arrow code) exists.
  3. Once you find the object, read its time and use iBarShift to find the candle index. Perhaps you should read the manual.
              ObjectGetIntegerENUM_OBJECT_PROPERTY_INTEGER → OBJPROP_TIME (coordinate zero.)
Reason: