EA or Tool to 'pick up' trades from crashing platform

 

We are using an EA we like very much but when the platform crashes which is alot lately (will not name UK based broker) the EA doesn't pick up the old orders, so if there is a floating loss, we may as well realize the loss and reset it. Thus, a crashing platform can cause the EA to actually lose money where otherwise it is fairly successful. Is there any EA that we could write that could at least manage these orders, or any suggestions how we could code this EA to 'pick up' the old orders?

Ironically, the same broker has a demo running the same EA that never crashed.

 
eliteeservices:

We are using an EA we like very much but when the platform crashes which is alot lately (will not name UK based broker) the EA doesn't pick up the old orders, so if there is a floating loss, we may as well realize the loss and reset it. Thus, a crashing platform can cause the EA to actually lose money where otherwise it is fairly successful. Is there any EA that we could write that could at least manage these orders, or any suggestions how we could code this EA to 'pick up' the old orders?

Ironically, the same broker has a demo running the same EA that never crashed.


I've seen this happen mostly when the EA is pushing too many orders in and out. Example....A stoploss might be sent to the server for every tick. Of course this is something that can only be altered at the code level. Outside of that, one would have to look at the Operating System settings and/or the PC hardware.

Codeing for orders that are already existing at the point the EA is turned on (for any reason) can and has been done. You have to place that code as the first thing the EA does before anything else.

.......As I look now at the functions avalible in MetaEditor, the only thing I that is usefull is the "OrdersHistoryTotal()" function. (This is just a thought) Then possibly useing that number to realize and manage existing orders by POOL instead of TICKET. ***I don't have any practice with management via order pool, so this may not work.***

OR.....Maybe a SCRIPT is in order. You see that it crashed/lost a connection? Run the script before turning the EA back on.

 
eliteeservices:

We are using an EA we like very much but when the platform crashes which is alot lately (will not name UK based broker) [...]

A crash of the MT4 application (rather than a loss of broker connection) is very unlikely to be the broker's fault.

The traditional cause of such problems is an EA using a DLL which has latent problems in its memory management. However, since build 226 of MT4 was released there has been a surge of problems reported on this forum which cannot be attributed to DLL issues. A number of people report that downgrading to build 225 fixes the problems.

But, regardless, a well-written EA should be capable of recovering from problems such as this. It's typically just a case of having the EA scan the MT4 order list to pick up any existing orders. Some EAs require extra "state" information which is not provided by the order list from the broker. If so, this should be written to disk rather than being held only in memory, and should be written periodically while the EA is running, rather than relying on deinit() getting called.

 

jlevel, it was nice of you to use your affiliate link in the post, you could try link cloaking. UPDATE: moderators removed. GOOD JOB!

Our EA is not using any DLL.

If platform crashing is not due to the broker, why are some brokers never crashing and others always crashing? On the crashing brokers, it coincidentally happens only when the account is profitable.

There are some good ideas here, I'll post our results if they work. This seems to be a big issue with 226/new MT4 that is crashing alot. For simple EAs it doesn't matter but if you have alot of orders it would reset the logic and thus you may as well at that point realize the profit or loss.

Reason: