Hi. I am writing my first strategy, and I believe I have found a bug. I am using the strategy tester and only EUR/USD on hour ask bars. In my onBar() method I write some stuff to a file, then call getBar, and then write more stuff to a file. However, after the call to getBar, nothing more gets written to my file. I moved the getBar call to the beginning of onBar() and now nothing gets written to my file! If I comment out the getBar call then everything works as it should. Here are relevant snippets:
public class DataDownloader implements IStrategy {
private IContext context = null;
private IEngine engine = null;
private IChart chart = null;
private IIndicators indicators = null;
private IHistory history = null;
private IBar ibar = null;
}
public void onBar(Instrument instrument, Period period, IBar askBar, IBar bidBar) throws JFException {
ibar = history.getBar(instrument, period, OfferSide.ASK, 1);
On a side note, it looks like I am receiving a lot of douplicate data. Here is an example:
Quote:
1245888060000,EUR/USD:1.39485
1245888070000,EUR/USD:1.39445
1245888080000,EUR/USD:1.39445
1245888090000,EUR/USD:1.3946
1245888100000,EUR/USD:1.3946
1245888060000,EUR/USD:1.39485
1245888110000,EUR/USD:1.3946
1245888120000,EUR/USD:1.3945
1245888130000,EUR/USD:1.3945
1245888140000,EUR/USD:1.39465
1245888150000,EUR/USD:1.39455
1245888160000,EUR/USD:1.3947
1245888120000,EUR/USD:1.3945
1245888170000,EUR/USD:1.3945
Surely this should be fixed on the server side? I could pretty easily code something to check for duplicate data, but I would think that Dukascopy would want to fix something as simple as this on their end to provide better quality service... Or maybe this is just a demo thing? Does the data from a real live account contain duplicates like this? There seems to be one duplicate for every ten bars on average...