Sometimes an order is send right before or during a connection problem with my MT4 broker and therefore isn't executed (Warning 075).

To workaround this problem, I've placed the following simplified code in a tock() (not tick() since my strategy is multi-asset):

Code
Trade = enterLong();
ThisTrade = Trade;

if(Trade != 0)
	{
  //Trade has been executed
	}
else
	{
  //Trade hasn't been executed	
	}


This code gets repeated during every tock() call as long as the order hasn't been executed.

However, once the broker connection gets reestablished, two orders get filled right after each other, so I considered placing a wait() function after 'ThisTrade...', but according to the manual this freezes the order execution process. A call() function doesn't seem a solution either because it has no mode for opening a trade (only closing and a couple of others).

Any suggestions to workaround this issue? Thanks.



Last edited by Grant; 06/16/22 16:24.