MT4 Java Requote and slippage

easy direct connection to any MT4 and MT5 server

MT4 Java Requote and slippage

To get symbol execution type of the symbol use following:

Execution execution = qc.GetSymbolInfo("EURUSD").Execution;

If symbol has Market execution slippage parameter doesn’t work, it also doesn’t depend what open price you put during order sending. Market execution means that position would be opened at any comfortable for broker price.

Instant execution means that you can specify maximum slippage and if price will go against you for more pips than specified in slippage parameter requote exception would be thrown.

double ask = qc.GetQuote("EURUSD").Ask;
Order order;
try
{
   order = oc.OrderSend("EURUSD"Op.Buy, 0.1, ask, 0, 0, 0, null, 0, new DateTime());
}
catch (RequoteException ex)
{
   ask = ex.Ask; // new price returned by server
}
catch (Exception ex)
{
   Console.WriteLine(ex.Message);
}

Leave a Reply