EA missing the mark with trades

 

Hi

I am experiencing some difficulties with a home-made EA

Are there any known occurences that would cause a requote from the platform directly or from the EA setup on mt4

I receive requote message though the brokers logs show no requotes, only a single request reaching them which the price had changed a large number of times from when my request was sent, please see the extract from the brokers server log:


2009.04.27 20:00:20 213.175.202.208 '204309': instant sell 0.90 GBPUSD at 1.46725 sl: 1.47025 tp: 0.00000 (1.46610 /1.46640), 115 price changed

2009.04.27 20:00:20 213.175.202.208 '204309': instant sell 0.90 GBPUSD at 1.46725 sl: 1.47025 tp: 0.00000 (1.46611 /1.46641), 114 price changed

I have attached the code for the sending function (This is the same sending function used for all orders of all symbols). This is the method that created the EA message.

As you can see there the method tries to send the order 4 times before it gives up.

Between tries the method:


A. Takes the ErrorCode returned from the MetaTrader OrderSend method and puts it in the error message.
B. Refreshes the rates using MetaTrader RefreshRates method.
C. Takes the current market rate using MetaTrader MarketInfo method and tries again.

As you can see the expert has no where it can decide to requote on it's own. It simply returns the error code from the MetaTrader OrderSend method.

I would be extremely grateful if you could look at this file attached to see if the problem lies there or elsewhere.

Many thanks,

Vincent.

Files:
 

VL

Maybe you need wider Slippage?

Also, is your slippage in sub-pip units, i.e. ordersSlippage=50 (meaning 5 full pips)?

Does this work on a demo account?

-BB-

 

Hi Barrowboy

the definition of the slippage var:

int ordersSlippage = 3;

I am not sure if it's in pips / sub-pips but it does not explain why I didn't see the requote log messages in the server and why the MetaTrader MarketInfo method did not refresh.

Any ideas?

Thanks for the help

Reason: