Code failed to open a position due to Invalid Price

 

This mql5 code failed to open a long position on the AUDJPY even though the price went below the buy price. Any idea why and how to fix it? Thank you

Here is the terminal output:

TradeLog: Trade request failed. Error = 4756

TRADE_RETCODE_INVALID_PRICE

request.price = 81.985   result.ask = 0.0 result.bid = 0.0


    int factore = StringFind(Symbol(), "JPY", 0) >= 0 ? 100 : 10000;
    double takeProfitPoints   = StringToDouble(result[3]) / factore;
    double stopLossPoints     = StringToDouble(result[4]) / factore;

      double takeProfitPrice = NormalizeDouble(_Bid + takeProfitPoints, _Digits);
      double stopLossPrice = NormalizeDouble(_Bid - stopLossPoints, _Digits);
      double lots = StringToDouble(result[2]);

      tradeRequest.action = TRADE_ACTION_PENDING;
      tradeRequest.symbol = _Symbol;
      tradeRequest.volume = lots;
      tradeRequest.price = _Ask;
      tradeRequest.sl = stopLossPrice;
      tradeRequest.tp = takeProfitPrice;
      tradeRequest.deviation = 2;
      tradeRequest.type = ORDER_TYPE_BUY_LIMIT;
      tradeRequest.type_filling = ORDER_FILLING_FOK;

      if(myOrderSend(tradeRequest, tradeResult)){
        Print("order line sell ok");
      }

bool myOrderSend(MqlTradeRequest &request,MqlTradeResult &result) 
  { 
   ResetLastError(); 
   bool success=OrderSend(request,result); 
   if(!success) 
     { 
      int answer=result.retcode; 
      Print("TradeLog: Trade request failed. Error = ",GetLastError()); 
      switch(answer) 
        { 
         case 10015: 
           { 
            Print("TRADE_RETCODE_INVALID_PRICE"); 
            Print("request.price = ",request.price,"   result.ask = ", 
                  result.ask," result.bid = ",result.bid); 
            break; 
           } 
         default: 
           { 
            Print("Other answer = ",answer); 
           } 
        } 
      return(false); 
     } 
     return(true); 
  }
Reason: