Making a 24 hrs running EA

 

I want to make an EA on hourly basis which will run throughout the day checking each and every 1 hr candle for a particular pattern and trade in the opening of the next candle. Please guide me how can I make this. 

 
Barno_07:

I want to make an EA on hourly basis which will run throughout the day checking each and every 1 hr candle for a particular pattern and trade in the opening of the next candle. Please guide me how can I make this. 


I'm waiting for this answer too lol.


 

Just add a few lines to make sure your EA only checks for the pattern on a new bar.

If you search the forum there are a huge number of examples about how to do this.

Often, it is far quicker to use the search function than wait for an answer on the forum, although I appreciate that searching requires more effort 


Hint: use time to detect a new bar. Ignore the methods that use volume or anything else.

Example in MQL4:

   static datetime last_bar = 0;
   datetime this_bar = Time[0];
   if(last_bar != this_bar)
     {
      Print("New bar");
      // add your code here that runs once per bar
      last_bar = this_bar;
     }
Reason: