EA using bar open price help required
Hi Ralph
Thanks for the reply. I am using 1 hour time frame. I think what you are saying is that since my code works on candle open time and doesn't care about ticks the results of the back testing using "open price only" is accurate. So really I should ignore the different result from using "every tick" because this method is creating erroneous data. This does create a bit of a conundrum since I want to use the candle open to enter trades but every tick to decide the trade exit, so I guess I can't use the back tester to test both at the same time.
static datetime time = 0; if (Time[0] == time ) return( 0 ); time = Time[0]; ... code for first-tick-for-bar activity here static int hour = -1; if ( TimeHour( time ) == hour ) return( 0 ); hour = TimeHour( time ); ... code for first-tick-for-hour here
Not every tick, of course, but maybe M1 is fast enough...
Hi Ralph
That's a good idea I shall use it because M1 gives plenty of resolution for the get out condition. Thanks a lot.
Hi all
I am using the standard bar open code
if (timeold!=Time[0]){
timeold=Time[0];
to kick off my EA decisions for trading when a new bar opens. In the back testing however I get completely different results using every tick for a run compared to using open prices only.
I would have thought the results should have been similar since I only use the prices involved in the candles of the prevoius 3 candles ie. Time[1],Time[2] and Time[3]
not the current candle Time[0].
I want my EA to use only the H,L,O,C data for each candle and I am not interested in all the ticks in between. Is my understanding of the back testing data options correct or should I be doing it another way.
Thanks
Paul