Logical operation with OrderOpenPrice() is not working

 

string  symbol                 = Symbol();

   

int     stop_loss               = 150;

int     take_profit            = 100;

double  lot_size              = 0.01;

int      slippage                = 10;

double  open_pip            = 50;

double  close_pip            = 18;

   

double  bid                     = MarketInfo(symbol, MODE_BID);   // Request for the value of Bid

double  ask                     = MarketInfo(symbol, MODE_ASK);   // Request for the value of Ask

double  point                  = MarketInfo(symbol, MODE_POINT); // Request for Point

  

if (OrdersTotal() == 0) {

      OrderSend(symbol, OP_BUY, lot_size * 1, ask, slippage, ask - stop_loss * point, ask + take_profit * point, NULL, 0, 0, Lime);

}


if (OrderSelect(0, SELECT_BY_POS) == true) {

   
if (OrderOpenPrice() == bid + open_pip * point) {  // This logical operation is never returning true. Even when the are equal.
      

Comment ("Success");

      }

}



Please help, if anybody knows the reason

 
farkhod007:

string  symbol                 = Symbol();

   

int     stop_loss               = 150;

int     take_profit            = 100;

double  lot_size              = 0.01;

int      slippage                = 10;

double  open_pip            = 50;

double  close_pip            = 18;

   

double  bid                     = MarketInfo(symbol, MODE_BID);   // Request for the value of Bid

double  ask                     = MarketInfo(symbol, MODE_ASK);   // Request for the value of Ask

double  point                  = MarketInfo(symbol, MODE_POINT); // Request for Point

  

if (OrdersTotal() == 0) {

      OrderSend(symbol, OP_BUY, lot_size * 1, ask, slippage, ask - stop_loss * point, ask + take_profit * point, NULL, 0, 0, Lime);

}


if (OrderSelect(0, SELECT_BY_POS) == true) {

   
if (OrderOpenPrice() == bid + open_pip * point) {  // This logical operation is never returning true. Even when the are equal.
      

Comment ("Success");

      }

}



Please help, if anybody knows the reason

https://www.mql5.com/en/forum/328726 
I think you will find ur answer here
Reason: