1. The Messages box is checked and the instrument is correct, too.
2. I tried another code I found on the Historical Data page in wiki.
SimpleDateFormat dateFormat dateFormat = new SimpleDateFormat("dd/MM/yyy HH:mm:ss");
dateFormat.setTimeZone(TimeZone.getTimeZone("GMT"));
try {
Date dateFrom = dateFormat.parse("05/10/2008 00:00:00");
Date dateTo = dateFormat.parse("04/10/2010 00:00:00");
} catch (ParseException e) {
e.printStackTrace();
}
List<IBar> bars = history.getBars(Instrument.EURUSD, Period.DAILY, OfferSide.ASK, dateFrom.getTime(), dateTo.getTime());
It took me hours to find out that I have to import some more packages in order to recognize the types. What I still don't understand is how to convert the Date type to the long type which is required by getTime().
**Edit**
Problem 1 solved. I just saw this thread
https://www.dukascopy.com/swiss/english/forex/jforex/forum/viewtopic.php?f=19&t=4284&p=6237&hilit=Historical+data#p6237I didn't know that in historical tester messages are printed in the tab itself and not in the messages tab.
But why does it print out data for every tick?
Is the getClose() method not working in HT?
**
**Re-Edit**
I fixed the first problem.
But the values I get are strange.
Please consider some of the messages for Eur/Usd, 24.11.2010 - 25.11.2010, five minute bars
Quote:
16:15:42 24.11.2010_23:59:50 Price: 1.33588 Volume: 3.6
16:15:42 24.11.2010_23:59:00 Price: 1.33588 Volume: 45.1
16:15:42 24.11.2010_23:55:00 Price: 1.33588 Volume: 143.9
16:15:42 24.11.2010_23:50:00 Price: 1.33588 Volume: 272.9
16:15:42 24.11.2010_23:45:00 Price: 1.33588 Volume: 368.8
16:15:42 24.11.2010_23:30:00 Price: 1.33588 Volume: 785.7
16:15:42 24.11.2010_23:00:00 Price: 1.33588 Volume: 1509.2
16:15:42 24.11.2010_20:00:00 Price: 1.33588 Volume: 6045.0
16:15:42 24.11.2010_00:00:00 Price: 1.33588 Volume: 86395.0
16:15:42 24.11.2010_23:59:40 Price: 1.33584 Volume: 1.5
16:15:42 24.11.2010_23:59:30 Price: 1.33577 Volume: 8.9
16:15:42 24.11.2010_23:59:20 Price: 1.33576 Volume: 7.6
16:15:42 24.11.2010_23:59:10 Price: 1.33562 Volume: 6.0
16:15:42 24.11.2010_23:59:00 Price: 1.33583 Volume: 17.5
16:15:42 24.11.2010_23:58:50 Price: 1.33596 Volume: 8.1
16:15:42 24.11.2010_23:58:00 Price: 1.33596 Volume: 48.9
16:15:42 24.11.2010_23:58:40 Price: 1.33603 Volume: 2.7
16:15:42 24.11.2010_23:58:30 Price: 1.33604 Volume: 19.9
16:15:42 24.11.2010_23:58:20 Price: 1.33612 Volume: 12.8
16:15:42 24.11.2010_23:58:10 Price: 1.33595 Volume: 0.0
16:15:42 24.11.2010_23:58:00 Price: 1.33595 Volume: 5.4
16:15:42 24.11.2010_23:57:50 Price: 1.3359 Volume: 3.0
16:15:42 24.11.2010_23:57:00 Price: 1.3359 Volume: 23.2
16:15:42 24.11.2010_23:57:40 Price: 1.33583 Volume: 1.5
I was using this code:
IBar bar = history.getBar(instrument, period, OfferSide.ASK, 1);
double close_bar = bar.getClose();
double barVolume = bar.getVolume();
long currentBarTime = bar.getTime();
console.getOut().println(sdf.format(currentBarTime) + " Price: " + close_bar + " Volume: " + barVolume);
Why does it print only one hour of 24/11/2010?
And why are the differenet start times of the bars not 5 Minutes after one another?
Is this a bug?