OrderOpenPrice return value 0

 
double point = MarketInfo(Pairs,MODE_POINT);
   double low = iLow(Pairs,PERIOD_H1,0);
   double high = iHigh(Pairs,PERIOD_H1,0);
   double lotsize = 0.00;
   bool newOrder = false;
   
   if(OrderSelect(lastOrder(Pairs),SELECT_BY_POS,MODE_TRADES) == true) {
      if(OrderType() == 0 && low <= OrderOpenPrice() - (Grid_Distance*point) && Lot_Setting == 1 && lastOrder(Pairs) != -1) {
         double ask = MarketInfo(Pairs,MODE_ASK);
         Alert(OrderOpenPrice()); Alert(lastOrder(Pairs)); Alert(OrderSymbol());
         //int tickets = OrderSend(Pairs,OP_BUY,Initial_Lot,ask,3,0,0);
         //if(tickets) { newOrder = true; };
      }  
      if(OrderType() == 1 && high >= OrderOpenPrice() + (Grid_Distance*point) && Lot_Setting == 1 && lastOrder(Pairs) != -1) {
         double bid = MarketInfo(Pairs,MODE_BID);
         int tickets = OrderSend(Pairs,OP_SELL,Initial_Lot,bid,3,0,0);
         if(tickets) { newOrder = true; };
      }
      if(OrderType() == 0 && low <= OrderOpenPrice() - (Grid_Distance*point) && Lot_Setting == 2 && lastOrder(Pairs) != -1) {
         double ask = MarketInfo(Pairs,MODE_ASK);
         Alert(lotsize); Alert(OrderSymbol());
         lotsize = OrderLots() * 2;
         int tickets = OrderSend(Pairs,OP_BUY,lotsize,ask,3,0,0);
         if(tickets) { newOrder = true; };
      }  
      if(OrderType() == 1 && high >= OrderOpenPrice() + (Grid_Distance*point) && Lot_Setting == 2 && lastOrder(Pairs) != -1) {
         double bid = MarketInfo(Pairs,MODE_BID);
         lotsize = OrderLots() * 2;
         int tickets = OrderSend(Pairs,OP_SELL,lotsize,bid,3,0,0);
         if(tickets) { newOrder = true; };
      }   
   }
double point = MarketInfo(Pairs,MODE_POINT);
   double low = iLow(Pairs,PERIOD_H1,0);
   double high = iHigh(Pairs,PERIOD_H1,0);
   double lotsize = 0.00;
   bool newOrder = false;
   
   if(OrderSelect(lastOrder(Pairs),SELECT_BY_POS,MODE_TRADES) == true) {
      if(OrderType() == 0 && low <= OrderOpenPrice() - (Grid_Distance*point) && Lot_Setting == 1 && lastOrder(Pairs) != -1) {
         double ask = MarketInfo(Pairs,MODE_ASK);
         Alert(OrderOpenPrice()); Alert(lastOrder(Pairs)); Alert(OrderSymbol());
         //int tickets = OrderSend(Pairs,OP_BUY,Initial_Lot,ask,3,0,0);
         //if(tickets) { newOrder = true; };
      }  
      if(OrderType() == 1 && high >= OrderOpenPrice() + (Grid_Distance*point) && Lot_Setting == 1 && lastOrder(Pairs) != -1) {
         double bid = MarketInfo(Pairs,MODE_BID);
         int tickets = OrderSend(Pairs,OP_SELL,Initial_Lot,bid,3,0,0);
         if(tickets) { newOrder = true; };
      }
      if(OrderType() == 0 && low <= OrderOpenPrice() - (Grid_Distance*point) && Lot_Setting == 2 && lastOrder(Pairs) != -1) {
         double ask = MarketInfo(Pairs,MODE_ASK);
         Alert(lotsize); Alert(OrderSymbol());
         lotsize = OrderLots() * 2;
         int tickets = OrderSend(Pairs,OP_BUY,lotsize,ask,3,0,0);
         if(tickets) { newOrder = true; };
      }  
      if(OrderType() == 1 && high >= OrderOpenPrice() + (Grid_Distance*point) && Lot_Setting == 2 && lastOrder(Pairs) != -1) {
         double bid = MarketInfo(Pairs,MODE_BID);
         lotsize = OrderLots() * 2;
         int tickets = OrderSend(Pairs,OP_SELL,lotsize,bid,3,0,0);
         if(tickets) { newOrder = true; };
      }   
   }
 
OrderOpen Price always return value 0 even if its true 
 
  1. Don't double post! You already had this thread open.
              General rules and best pratices of the Forum. - General - MQL5 programming forum (2017)

  2. Please edit your (original) post and remove the non-code, duplicated text.

  3. Do you really expect an answer? There are no mind readers here and our crystal balls are cracked. Always post all relevant code (using Code button) or attach the file.
         How To Ask Questions The Smart Way. (2004)
              Be precise and informative about your problem

    We have no idea what lastOrder(Pairs) is. You call it twice, in the OrderSelect and after. It had better not do its own OrderSelect. And why are you calling it five times instead of saving the result once in a variable?

  4.    double low = iLow(Pairs,PERIOD_H1,0);
       double high = iHigh(Pairs,PERIOD_H1,0);
    

    On MT4: Unless the current chart is that specific symbol(s)/TF(s) referenced, you must handle 4066/4073 errors before accessing candle/indicator values.
              Download history in MQL4 EA - Forex Calendar - MQL4 programming forum - Page 3 #26.4 (2019)

  5. if(OrderType() == 1
    Don't hard code constants. Use the proper enumeration (OP_SELL).