Detecting when pc resume after sleep and update data

 

Hi everybody.

I have a .net app that I use for to connect the mt4 and get data and others functions.

When my pc sleep or suspend and after sometime resume again, the mt4 auto update the data in charts. Including a small sound play.

The problem is that my app not detect it. I do it detect when my pc sleep and resume and update the quotes send a command to mt4 but the mt4 not connect and update immediately, have a little gap or time 5 or 10 seconds or more to download all quotes and play the sound warning that all is ok. So I put in my app also a timer delay for only update after 20 seconds. But this is not a pretty solution.

Ok, I make in my script a function that compare minute by minute in mt4 but sometimes not have any buyers or sellers in the next minute and my script undertanding that need send a update command to my app.

Anybody have a good idea for detecting when the mt4 are right to send the update command to my app after pc resumed?

Sorry my english, if need I try again.

 

Thanks 

 
 
Thanks man, I will try and post the result...
 
bisewski: a good idea for detecting when the mt4 are right to send the update command to my app after pc resumed?
  1. This has been discussed before. MT4 doesn't detect sleep and doesn't update the chart properly on the reconnect.
  2. You are using it for trading. The EA can't when you shutdown. Get a VPS.
 

ok, I try to use IsConnected and function more or less because this function is started before to download all data. first connect and after down datas...I need to use a slleep or something but also not pretty solution. So how I save all data in .csv files and after send quotes in PIPE connections, so I create a button in my app where I send a command to mt4 resave in .csv files and reload the data in my app.

 

Thanks for all. 

Reason: