Solve Stoploss Slippage

 

Hi all

How do you solve stop loss slippage. On a demo account account the stoploss is hits the stoploss perfectly but on a real account it's a different story (Using the same ECN Broker).

Below I attached images to look at the different Stop loss for demo account: 

For real account here here is the stoploss: 

How do you solve this in MQL4 code? I know you cannot completely reduce slippage. I just want to know how to keep the same stoploss just like demo. here is my code to solve it in MQL4 but it does not solve the problem.

double AdjustSLForSlippage(int CMD,double NewSL,double SlippagePips)
 {
  if(CMD==OP_BUYSTOP)
  {
   return NewSL-SlippagePips*Pips();
  }
  
  else if(CMD==OP_SELLSTOP)
  {
   return NewSL+SlippagePips*Pips();
  }
  return(NewSL);
 }
double SLBuy=Bid-StopLoss*Pips();
  
 SLBuy=AdjustSLForSlippage(OP_BUYSTOP,SLBuy,Slippage);
double SLSell=Bid+StopLoss*Pips();
  
 SLSell=AdjustSLForSlippage(OP_SELLSTOP,SLSell,Slippage);
 
Scalper8:
keep the same stoploss just like demo

A stop loss is a pending order on your broker. They cannot guarantee where it gets hit and you cannot know in advance as the market condition determines slippage. 

 
Yashar Seyyedin #:

A stop loss is a pending order on your broker. They cannot guarantee where it gets hit and you cannot know in advance as the market condition determines slippage. 

I see, with other trades (online) I've seen stop loss hit the specific stop loss all the time 

 
Scalper8 #:

I see, with other trades (online) I've seen stop loss hit the specific stop loss all the time 

Some brokers offer fixed spread accounts which guarantee pending execution at exact price. But those accounts are not popular because they do not offer an exciting environment for scalping.

 
Yashar Seyyedin #:

Some brokers offer fixed spread accounts which guarantee pending execution at exact price. But those accounts are not popular because they do not offer an exciting environment for scalping.

Do you think stop levels or freeze levels can cause slippage?

 
Scalper8 #:

Do you think stop levels or freeze levels can cause slippage?

No. They are totally different topic.
 
Yashar Seyyedin #:
No. They are totally different topic.

The code I posted above does not solve my problem, in my EA it consists of breakeven, trailing stops & pending price trail do you think any of these might cause slippage?

 
Scalper8 #:

The code I posted above does not solve my problem, in my EA it consists of breakeven, trailing stops & pending price trail do you think any of these might cause slippage?

Slippage is a order execution issue. You expect to sell at x but there is no one to buy from you. You will have to sell it cheaper. This is called slippage.
 
It's best to ask the broker, I think they will explain to you why this exists.
 
Yashar Seyyedin #:
Slippage is a order execution issue. You expect to sell at x but there is no one to buy from you. You will have to sell it cheaper. This is called slippage.

Got it, even with a dedicated VPS I still experience this.  

 
Vasile Verdes #:
It's best to ask the broker, I think they will explain to you why this exists.

I doubt I'll be assisted, I'll give it a try