EA Start() Loop

 

Is there any reason why a loop (like the one below) wouldn't be an effective method?


My EA actively monitors a couple of indicators and then monitors active orders for trailing stop's and take profit's as well as reads/writes to multiple files.


start()                    // Special function start()
   {
   while(!IsStopped())     // Until user.. 
      {                    // ..stops execution of the program
      RefreshRates();      // Data renewal
      //......................The main code of the program is specified here
      Sleep(5);            // Short pause
      }
   return;                 // Control is returned to the terminal
   }
 
mixtermind wrote >>

Is there any reason why a loop (like the one below) wouldn't be an effective method?

My EA actively monitors a couple of indicators and then monitors active orders for trailing stop's and take profit's as well as reads/writes to multiple files.

May be I don't understand your question or I just don't see the purpose of doing such a thing... need more explaination...I am just wondering if you have been through that https://book.mql4.com/basics/common ?

 
Jacques366:

May be I don't understand your question or I just don't see the purpose of doing such a thing... need more explaination...I am just wondering if you have been through that https://book.mql4.com/basics/common ?

The concept of looping the start function was taken from https://book.mql4.com/special/index. I've read the book but would like some insight from people who have experience using the start loop.

 

Using a script with MarketInfo(SymbolName, MODE_BID/ASK/etc.) makes more sense for asynchronous processing.