Check pending order

 

Hi,

I have this situation where my EA opened a pending order at 1.30330 and I have this function to check if there is any pending order when passing value 1.3033 and its not working

//+------------------------------------------------------------------+
//| Check Pending Orders                                             |
//+------------------------------------------------------------------+
bool CheckPendingOrders(ENUM_ORDER_TYPE type, double price)
  {
//---

   for(int i = OrdersTotal() - 1; i >= 0; i--)
   {
      if(order.SelectByIndex(i) &&
         order.Symbol() == _Symbol &&
         order.Magic() == MagicNum &&
         order.OrderType() == type &&
         order.PriceOpen() == price)
         {
            return(true);
         }
   }

//---
   return(false);
  }

any idea what is wrong although the price I passed is the same as the pending order's price

 

although when I check the order.priceopen is the same as the input price

when I do a priceopen - price, i got this result

2021.09.02 22:45:41.622 2018.09.05 03:00:00   2.220446049250313e-16

Why am i not getting a 0?

 
it is a very strange problem because if I add a 1 point to the price, it works well
 
Dua Yong Rew: although the price I passed is the same as the pending order's price

Doubles are rarely equal. Understand the links in:
          The == operand. - MQL4 programming forum #2 (2013)