Mt4 closes my trades when my computer hibernates. How do I fix it

 
Basically when I come home from work my computer has gone into hibernate mode and when I open my mt4 window the trades have disappeared. Luckly I am trading a demo account and have not lost any real money.
 

1. Assess whether the 2 events are connected. Did the re-initialization of your EA cause the orders to be closed? Or were they closed by a broker-invoked stoploss for example?

2. If the former then:

a) Stop your computer from hibernating

and/or

b) If you have access to the source code (.mq4), then alter the logic of your EA so that orders are not closed upon initialization


CB

 
cloudbreaker wrote >>

1. Assess whether the 2 events are connected. Did the re-initialization of your EA cause the orders to be closed? Or were they closed by a broker-invoked stoploss for example?

2. If the former then:

a) Stop your computer from hibernating

and/or

b) If you have access to the source code (.mq4), then alter the logic of your EA so that orders are not closed upon initialization

CB

CB, I like option b). How do I alter the logic of my EA so my orders are not closed upon initialization?

 

Hi JetWash,

As far as I know, your non-essential programs and services are also 'suspended' in the Hibernation mode. This would include your MT4 apps.

Have you tried putting you computer into the ('Stand-By or Sleep mode' instead ? If your computer supports it, the CPU and some of your cards (if you have them set for this) will be throttled back and will also put your monitor into low power standBy and stop your HDDs from spinning (if you have them set that way), but still allow them to respond to your applications and services that you have running to utilize them if it needs to.

Good luck

 
jetwash58:

CB, I like option b). How do I alter the logic of my EA so my orders are not closed upon initialization?

We'd need to see your code to check that out, but first have a look for use of OrderSelect() and OrderClose() in the init() or deinit() functions.


CB

Reason: