Get last order information in mql4

Hi I’m new at mql4 and i’m trying to develop an EA strategy for training.
I want to get Last open order (open price):

double LastOrderCurrent(string info,int type=-1)
{
 for(int i=OrdersTotal()-1;i>=0;i--)
 {
  bool select=OrderSelect(i,SELECT_BY_POS,MODE_TRADES);
  string   sy=OrderSymbol(),
           mm=OrderComment();
  int      mn=OrderMagicNumber(),
           ty=OrderType();
  double   lo=OrderLots(),
           op=OrderOpenPrice(),
           pt=OrderProfit(),
           tp=OrderTakeProfit(),
           sl=OrderStopLoss();  
  datetime om=OrderOpenTime();
                    
  if(sy==Symbol()&&mn==MagicNo)
  {
   if(ty==type||type==-1)
   {
    if(info=="Lots")return(lo);
    else if(info=="OpenPrice")return(op);
    else if(info=="Profit")return(pt);
    else if(info=="Type")return(ty);
    else if(info=="TP")return(tp);
    else if(info=="SL")return(sl);
    else if(info=="OpenTime")return(om);
    else if(info=="Comment")return(mm);
   }
  } 
 }
 return(0);
} 

ًWhen i trying to get any info like:
LastOrderCurrent(“OpenPrice”);
returned value is “0.0”

what a wrong