Download MetaTrader 5

Question about slippage in EA code

To add comments, please log in or register
Iason Solomos
366
Iason Solomos  

Good afternoon all, I would like to ask about the following line of code I have come across in an EA I was running:

 

int Slippage=100;  

 

What is this 100? Obviously it can't be pips. But then what is it? If I want to control the amount of slippage in an order up to say, 5 or 6 pips, what value should I input? 

 

Also from what I understand the following line is which actually does the order:   OrderSend(Symbol(), OP_SELL, Lots, op, Slippage, 0, 0, comm, Magic, 0 ,Red); 

 

Can someone please very briefly explain this function call to me? What is Symbol(), magic, 0 ,Red? Is this function the default call for market orders (meaning you want to buy or sell at current price)?

 

Any guidance would be very welcome, thank you in advance. 

Khurram Mustafa
46369
Khurram Mustafa  
Darksoul:

Good afternoon all, I would like to ask about the following line of code I have come across in an EA I was running:

 

int Slippage=100;  

 

What is this 100? Obviously it can't be pips. But then what is it? If I want to control the amount of slippage in an order up to say, 5 or 6 pips, what value should I input? 

 

Also from what I understand the following line is which actually does the order:   OrderSend(Symbol(), OP_SELL, Lots, op, Slippage, 0, 0, comm, Magic, 0 ,Red); 

 

Can someone please very briefly explain this function call to me? What is Symbol(), magic, 0 ,Red? Is this function the default call for market orders (meaning you want to buy or sell at current price)?

 

Any guidance would be very welcome, thank you in advance. 

Please Read Documentation section, you will whole book "Reference"

Symbol() = Current Pair which is opened

Magic = Is the number of execution, it will be your's own

Red = Is the colour of this event happen 

Iason Solomos
366
Iason Solomos  
Khurram Mustafa:

Please Read Documentation section, you will whole book "Reference"

Symbol() = Current Pair which is opened

Magic = Is the number of execution, it will be your's own

Red = Is the colour of this event happen 

Thank you for the heads up, I'm new to the site. Does slippage = 100 mean 100 points, so 10 pips?
Alain Verleyen
Moderator
35127
Alain Verleyen  
Darksoul:
Thank you for the heads up, I'm new to the site. Does slippage = 100 mean 100 points, so 10 pips?
Yes 100 points.
To add comments, please log in or register