How to get time when a rectangle is drawn to compare with candlestick times

 

I am using the following code to access a rectangle object manually drawn on a chart:

void FindTradeInRect()
{

   static datetime lastTime = 0;
   datetime currTime = iTime(Symbol(),PERIOD_M1,0);

   if (currTime>lastTime)

   {

      for (int i=ObjectsTotal(0, 0, -1)-1; i>=0; i--)

      {
      
      //ObjectsTotal(

         string name = ObjectName(0, i, 0, -1);

         if (ObjectGetInteger(0, name, OBJPROP_TYPE, 0)==OBJ_RECTANGLE && ObjectGetString(0,name,OBJPROP_TEXT)=="")  {
             //color rectColor = color(ObjectGetInteger(0,name,OBJPROP_COLOR));  
             
             
             double maxVal = MathMax(ObjectGetDouble(0,name,OBJPROP_PRICE,0), ObjectGetDouble(0,name,OBJPROP_PRICE,1));
             double minVal = MathMin(ObjectGetDouble(0,name,OBJPROP_PRICE,0), ObjectGetDouble(0,name,OBJPROP_PRICE,1));
             
             //search candles in rectangle created after time that rectangle was drawn
             

      lastTime = currTime;
         }
   }
      }
}


I placed the above code in the tick method to know exactly when a rectangle is drawn. How can I get the time immediately after drawing the rectangle and compare candlesticks drawn after the rectangle's draw time?