Quote:
|
Originally Posted by SteveBrown
Programming my first EA, I face the problem of how best to detect the start of a new hourly candle. There appears to be only one method, and that is to wait for the first tick to come along which falls into the next time period. That is because there appears to be only one way the start() function is called in my EA, and that is when the server pumps out a new tick. So, if a tick occurs at 01:59, and the next tick comes at 02:02, the EA detects the end of the 01:00 candle and the start of the 02:00 candle at 02:02, two minutes after the top of the hour. My EA is designed to run on the H1 chart, and it makes trading decisions based upon the close prices of hourly candles. I would like my EA to make those decisions at the top of the hour, rather than wait for the first tick that occurs in the new hour. Is there any method by which the start() function in my EA can be called as soon as a new hour begins on the clock?
|
No, you do not have any way to do that, but maybe you can write an endless script ...
But what should be the avantage to run the EA before the first tick ?