Making a 24 hrs running EA

To add comments, please log in or register
Barno_07
31
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. 

aeclubwoi
5
aeclubwoi  
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.


honest_knave
Moderator
2302
honest_knave  

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;
     }
To add comments, please log in or register