IsConnected()

 

Can someone explain to me how IsConnected() can work after int start()

if anything is written after int start() is execute only after a new tick How can the EA get to it at all

thanks

 

you can loop into start() to check new tick and...isconnected()

 
Matutin:

you can loop into start() to check new tick and...isconnected()


But what would help me to loop into start(), if a new tick didn't comes

for example if automaticly i restart the terminal & is no connection than the EA didn't comes to the loop

 
qjol:


But what would help me to loop into start(), if a new tick didn't comes

for example if automaticly i restart the terminal & is no connection than the EA didn't comes to the loop

Can help you in a script, not EA.
 
robofx.org:
Can help you in a script, not EA.

in a EA into init() ?
 
qjol:

in a EA into init() ?
Possible.
 
 
robofx.org:
Possible.


sorry after int init() didnt't work i chack it out

#property copyright "Copyright © 2010, MetaQuotes Software Corp."
#property link      "http://www.metaquotes.net"

#import "shell32.dll"
int ShellExecuteA(int hwnd,string Operation,string File,string Parameters,string Directory,int ShowCmd);
#import

int init()
  {
   Print ("starting count");
   Sleep(10000);
   Print ("chacking");
   if (!IsConnected())
   {
   Print ("restarting ap in 5 sec");
   Sleep(5000);
   ShellExecuteA(0, "Open", "d:\r_ap.bat", "", "", 1); 
   }

   return(0);
  }

 

Expanding on my link above... I run a seperate EA to monitor connection status. It basically has all the code for my test coded inside start with a sleep at the end. Start is basically a big loop, when it finishes, it goes back to the beginning. But rather than wait for a tick to trigger the start, I call start() inside init(). In this way start() continues to loop with the sleep and init() never finishes so the code runs based on time intervals from sleep rather than waiting for a tick... the link above shows the principal...

hth

V

 
Viffer:

Expanding on my link above... I run a seperate EA to monitor connection status. It basically has all the code for my test coded inside start with a sleep at the end. Start is basically a big loop, when it finishes, it goes back to the beginning. But rather than wait for a tick to trigger the start, I call start() inside init(). In this way start() continues to loop with the sleep and init() never finishes so the code runs based on time intervals from sleep rather than waiting for a tick... the link above shows the principal...

hth

V


thanks
 
qjol:


But what would help me to loop into start(), if a new tick didn't comes

for example if automaticly i restart the terminal & is no connection than the EA didn't comes to the loop


Just call start() from init () ...and you will be in start() even no tick coming !
Reason: