OrderSend returns REQUOTE error but is not logged in the broker's server

 

Hi

I am experiencing some difficulties with an EA that I have written.

I have a ping to the trading server of 8ms running on a VPS however I receive requotes to the same market price, see below journal extract:

Message from EA:

GBPUSD failed (requote). Updating GBPUSD position from 1.46725000 to 1.46725000. GBPUSD failed (requote). Updating GBPUSD position from 1.46725000 to 1.46725000. GBPUSD failed (requote). Updating GBPUSD position from 1.46725000 to 1.46725000. GBPUSD failed (requote). Updating GBPUSD position from 1.46725000 to 1.46725000.

I receive this message though the brokers logs show no requotes, only a single request reaching them which the price had changed an extraordinary number of times from when my request was sent, please see below 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,

Moshe.

Files: