Error: 10013 Invalid request buying stocks

 

Hi guys I do have a problem with my buyflex function, following the log

2018.04.30 03:05:34.715 2018.01.23 17:10:19   failed request buy 1.00K 2 at 18.29000  sl: 18.14000 tp: 18.42000 [Invalid request]

2018.04.30 03:05:34.715 2018.01.23 17:10:19   Function: BuyOrderFlex99 Error: 10013 Invalid request


Now, follow the code

                   MqlTradeRequest request={0};

                   MqlTradeResult  result={0};

                   request.action = TRADE_ACTION_DEAL;                    // setting a deal order

                   request.magic = 1;                                                  // ORDER_MAGIC

                   request.symbol = SYMBOL_FILLING_IOC;                   // symbol

                   request.volume= 1000;                                            // volume in lots

                   request.price = SymbolInfoDouble(Symbol(),SYMBOL_BID);

                   request.sl = ceil((GetIndicator(handle29,0,current)*(-MULTIPLICADOR_ATR_STOP)+Bid())*100)/100;            // THESE ARE NOT THE PROBLEM

                   request.tp =  ceil((GetIndicator(handle13,0,current)*(+MULTIPLICADOR_ATR_GAIN_FIXO)+Bid())*100)/100;  // THESE ARE NOT THE PROBLEM

                   if(ATIVA_GAIN_FIXO == 0)request.tp = Ask()*2;                   // Take Profit specified

                   request.deviation= 5;             // deviation in 5 points

                   request.type = ORDER_TYPE_BUY;

                   request.comment = "Order";

                   

                   

                   ZeroMemory(result);

                   OrderSend(request,result);



Any help guys ? I am out of options here.

 
oh, I have to say, this code works perfectly well in the future markets which have prices with integers divisible by five. But, it does not work with stocks with decimals prices.
 

Please use the </> button to insert your code.


 
Eleni Anna Branou:

Please use the </> button to insert your code.


Edited.

 
Solved. 

Just with the code

 request.type_filling =ORDER_FILLING_RETURN;
 
All trades are showing this today, on the currency markets. Is it a problem with the terminal?