Max SlipPage

 

In MQL4:

How can I set the Maximun slippage in order to avoind this message of MT4 (and the order is not generated)?

"requote xxx / xxx for open [buy/sell] [lot] [currencypair] at xxxxx sl. xxxx tp. xxxxx"

I have tried with 3 and then 5 but sometimes I still get the message and the order is not generated.

Thanks and Regards,

 
brugiafreddo:

I have tried with 3 and then 5 but sometimes I still get the message and the order is not generated.

Just use a higher value. Note that the higher the value the higher u let your broker slip u. So don't be surprised if it happens.
 
the OrderSend slippage is in units of points. On a 5 digit broker a pip is not a point. You'll need 30 or 50.
//++++ These are adjusted for 5 digit brokers.
double  pips2points,    // slippage  3 pips    3=points    30=points
        pips2dbl;       // Stoploss 15 pips    0.0015      0.00150
int     Digits.pips;    // DoubleToStr(dbl/pips2dbl, Digits.pips)
int init() {
    if (Digits == 5 || Digits == 3) {   // Adjust for five (5) digit brokers.
                pips2dbl    = Point*10; pips2points = 10;   Digits.pips = 1;
    } else {    pips2dbl    = Point;    pips2points =  1;   Digits.pips = 0; }
OrderSend(... SlippagePips * pips2points, Bid - SLPips*pips2dbl ...
 
Like Gordon said, if you send an order to a broker with max slippage of 5-10, they'll slip your order just because they know you'll still take, look out.
Reason: