1 (edited by yonkuro 2017-02-23 05:09:40)

Topic: Retry Count

Hi Popov,

may I know, what do these lines mean?

#define TRADE_RETRY_COUNT 4
#define TRADE_RETRY_WAIT  100

If I want to increase the closing retry number, should I modify those lines?

or maybe this line?

Print("Close Position retry no: "+IntegerToString(attempt+2));

Regards.

Re: Retry Count

TRADE_RETRY_COUNT number sets how many times the EA tries to send an order. You can increase the number if you want, however this helps only in certain conditions as for example a temporary internet connection loss or some temporary issues with the trading terminal or broker.

TRADE_RETRY_WAIT  sets a Sleep interval in millisecond. 100 milliseconds are equal to 0.1 seconds.

The default settings makes the app repeating a failed order up to 4 times withing 0.4 seconds. You can modify the numbers, but if the expert or the broker have problems, this is not a fix.

The "Print" command only prints notes. It doesn't reflect on the trading in anyway.

3 (edited by yonkuro 2017-02-24 14:37:20)

Re: Retry Count

Thanks for your explanation smile

4 (edited by BK777 2017-08-07 16:36:35)

Re: Retry Count

Hi Popov,

I am running to 3x Port. Experts on two MT4 terminals and I am facing some serious requote issues.

Both terminals are running on same VPS, one is showing 609ms the other showing 406ms and trades are not open on the accounts due to requote which I think is better of the latency issue.

This broker uses Instant Execution mode.

I have tried to set;

#define TRADE_RETRY_COUNT 40

And also make the chart as 'light' as possible, no indicators etc

but it doesn't seems to help. Do you have any other suggestions?

Thank you.
BK

Re: Retry Count

The portfolio calculation latency cannot be a reason for re-quotes because the expert takes the order execution price just before sending an order.

      if (IsTradeContextFree())
        {
         double price=MarketInfo(_Symbol,command==OP_BUY ? MODE_ASK : MODE_BID);
           ...        
            ticket=OrderSend(_Symbol,command,amount,price,10,0,0,comment,signal.MagicNumber,0,arrowColor);

6 (edited by BK777 2017-08-08 05:19:49)

Re: Retry Count

Hi Popov,

You are correct. The portfolio calculation latency is not the issue.

What I was asking is whether is there any thing else I can add to the EA codes to make sure that all trades are open correctly even when there is a broker's requote?

Beside increasing values below;
#define TRADE_RETRY_COUNT 40
#define TRADE_RETRY_WAIT  300


I came across something on the MLQ website, can this EA be incoporated to better handle broker's requote?

Thank you.

Post's attachments

orderreliable_2011.01.07.mqh 39.29 kb, 3 downloads since 2017-08-08 

You don't have the permssions to download the attachments of this post.

Re: Retry Count

I think we send the signals correctly.

Try your expert with another broker just to see if it works better.

Re: Retry Count

I wonder what time frame you are using......  and what is the delay be tween your computer and VPS and broker.

9 (edited by BK777 2017-08-09 10:47:56)

Re: Retry Count

Just H4 on EU, UJ and EJ.

On each chart, the latency is between 200ms - 450ms

I am connect via a VPS, the data centre is showing around  2.8ms- 4.5ms