Hi all,
when back testing my EA I have an issue with the iBarShift() function.
I am trying to find the bar number based on a time.
- I find for example the highest high - int i=iHighest(NULL,0,MODE_HIGH,10,1)
- I then want to find out what bar the shift is on so try, for example int Bar=iBarShift(NULL,0,Time[i]);
- This returns -1 as the bar is not found (int Bar=iBarShift(NULL,0,Time[0]); is also not found).
- I only use iBarShift() because Bars-i doesn't work either.
- Print (Bars); at the start of my EA gives me 1001 - altough Time[0] gives me the specified start date (for example 01.12.2010) and I can draw a VLINE on the chart to show the start of my testing.
- As Bars is 1001, the EA returns 1001 (Bars) - 4 (i). But Bar 997 is somewhere in Jan 2007, obviously messing up my results (when trying to find out a bar which should be in Dec 2010).
Any ideas guys?
Thanks,
G