I send Slippage 0 but my broker results my position with big slippage

 

Hi,

MqlTradeRequest request;

   MqlTradeResult result;

   ZeroMemory(request);

   ZeroMemory(result);

   request.action = TRADE_ACTION_DEAL;

   request.type = ORDER_TYPE_BUY;

   request.symbol = _Symbol;

   request.volume = NormalizeDouble(buy_volume, _Digits);

   double price = SymbolInfoDouble(Symbol(),SYMBOL_ASK);

   request.tp = NormalizeDouble(price+tpPips*_Point,_Digits);//NormalizeDouble(tp,_Digits);//

   if(slPips!=-1){

      request.sl = NormalizeDouble(price-slPips*_Point,_Digits);

   }

   request.price = SymbolInfoDouble(_Symbol, SYMBOL_ASK);

   request.type_filling = ORDER_FILLING_FOK; 

   request.deviation = 0;//slippage
   request.comment = comment;

   if (OrderSend(request, result))

   {

      //some codes

   }


i send slippage 0, i am using this code in mql5 for EURJPY and after the transaction closed, i see that there is slippage around 50-100 pips.
I ask my broker (H**) why it applies a slippage and i dont give any slippage,
they says it happens sometimes because of the market conditions. But it happens often. 
When i try this code for mql4, it doesnt give slippage in the same broker. How is that possible?

 
Your topic has been moved to the section: Expert Advisors and Automated Trading
Please consider which section is most appropriate — https://www.mql5.com/en/forum/172166/page6#comment_49114893
MQL5 forum: Expert Advisors and Automated Trading
MQL5 forum: Expert Advisors and Automated Trading
  • www.mql5.com
How to create an Expert Advisor (a trading robot) for Forex trading
 
Huseyin Furkan Ozturk: i send slippage 0, i am using this code in mql5 for EURJPY and after the transaction closed, i see that there is slippage around 50-100 pips. I ask my broker (H**) why it applies a slippage and i dont give any slippage, they says it happens sometimes because of the market conditions. But it happens often.  When i try this code for mql4, it doesnt give slippage in the same broker. How is that possible?

The maximum deviation/slippage parameter has no effect when using Market Execution Policy. It only has effect on Instant Execution Policy.

I don't know about the other execution policies because I have little experience with them, but here are more documented details:

 
Fernando Carreiro #:

The maximum deviation/slippage parameter has no effect when using Market Execution Policy. It only has effect on Instant Execution Policy.

I don't know about the other execution policies because I have little experience with them, but here are more documented details:

Please, let me know how should understand it. Should i change the action value for "request.action = TRADE_ACTION_DEAL;"

If i set 

request.action SYMBOL_TRADE_EXECUTION_REQUEST
Will it sell at the value i gave when it reach to the tp value? if not, what should i give for this action or something else?
 
 
Huseyin Furkan Ozturk #: Please, let me know how should understand it. Should i change the action value for "request.action = TRADE_ACTION_DEAL;" If i set  Will it sell at the value i gave when it reach to the tp value? if not, what should i give for this action or something else?

No, the execution policy is not something you can change in your code. Please read the documentation I provided, before answering.

The execution policy is something set by the broker on your account type and also depends on the symbol's asset class.

It is clearly stated in the documentation that I linked ...

Execution mode for each security is defined by the brokerage company.