EA operates on "tick" independant of period - NOT the bar..

 

Hi guys,

In response to an earlier thread I opened, I am having significant issues in determining how to execute a function per one bar of the chosen periodicity.

That is, in the EA backtester in MT4, if i select Period: H1, I wish to essentially recieve an 'interrupt' every time a bar of period 1H closes (or opens, or whatever). However, the EA is 'interrupted' every tick - including inter-ticks (ticks within H1) as would be expected for the backtester.

I am unsure how i can quantize these ticks into representing the close of a bar (like a visual bar of 1H as you would normally see in the chart window on periodicity = H1). I wish to check for trade viability at the end of each bar given the chosen periodicity.

Any suggestions would be appreciated - I have a feeling this is an easy solution, but i've been pulling my hair out for days with numbers that don't make sense (i made a thread a few days back on this)..

Cheers,

Sebastian

 
 


Thankyou again.. I implemented a very similar solution about 10 minutes ago.. I just checked Hour() and used a buffer to check if the hour had changed.. this is good enough for me.. :) thanks again.