IsConnected() question...

 
Hi,

I have a question about the "IsConnected" function with regards to how it works. If this function is used within an Expert, it will obviously provide "true" when MetaTrader is connected to the trading server. However, if the the connection is broken for any reason, MetaTrader won't be receiving any quotes. I presume that this would mean that any running Experts won't be triggered (run) and consequently, "IsConnected()" never executed (at least that is the way I understand it....). And this would mean that Alerts/e-mails etc wouldn't be sent to let the trader know that the connection is down....

Are Experts triggered (run) occasionally if the connection to the trading server is broken? If so, how often?

Thanks in advance for your help with this.
 
1. experts run with incoming ticks only but there is no 1000 milliseconds limitation and expert can work very long and from time to time ask for IsConnected
2. scripts can launch manually not depending on incoming ticks
 
Hi Slawa,

Thanks for your quick answer...

However, the problem I face is that I'm trying to set up a completely automated trading environment that I can walk away from and let the system make the decisions, take the trades etc. The only time I want anything to do with it (at least, ideally) is if something goes wrong. Obviously, to know something is wrong, I have to set the system up to e-mail/txt my mobile phone with any problems...

For the above reason, I don't think a script will do the job, as this has to be started manually (at least, as far as I'm aware). This leaves the option of running the expert for a seriously long time - however, I don't see how this can work, as it's on the ticks that I need the Expert to make it's decisions to buy/sell etc. Are you suggesting that I write an expert that basically runs forever and monitors the price changes internally, rather than being run with each new tick? All I can imagine with this option is that after several hours, I would have hundreds of copies of the same Expert running at the same time as none of them would be finishing?

Any help on the above would be greatly appreciated.


Regards,

Coen Willemse
Reason: