Hello support,
I'd like to run a strategy from a ITesterClient with custom dates interval.
My code is:
client = TesterFactory.getDefaultInstance();
SimpleDateFormat dateFormat = new SimpleDateFormat("dd/MM/yyyy HH:mm:ss");
Date dateFrom = dateFormat.parse("01/05/2006 00:00:00");
Date dateTo = dateFormat.parse("02/05/2006 00:00:00");
client.setDataInterval(ITesterClient.DataLoadingMethod.ALL_TICKS, dateFrom.getTime(), dateTo.getTime());
where client is a ITesterClient. The exception it causes is:
IllegalArgumentException: Desired from time is earlier than tick history start time '2006-04-30 22:00:00:000' > '2007-03-30 16:01:15:688'
I know there isn't any ticks data before 2007. I don't mind as I will filter by Period.ONE_MINUTE in the strategy. The only reason I have used ALL_TICKS is because I can't find any other way to retrieve data in a custom dates interval from a ITesterClient. It works when I ask for the interval 02/05/2013-02/05/2013.
I've also tried with:
client.setDataInterval(Period.ONE_MIN, OfferSide.ASK, ITesterClient.InterpolationMethod.FOUR_TICKS, dateFrom.getTime(), dateTo.getTime());
But then I recieve this other exception I don't understand at all because the dates should be ok as the previous example.
ERROR AbstractHTFlowDataCreator - from(2006-04-30 22:00:00:000) > to(292269055-12-02 16:47:04:192)
java.lang.IllegalArgumentException: from(2006-04-30 22:00:00:000) > to(292269055-12-02 16:47:04:192)
How can I solve the problem? Is any other way to do this?
Sorry in advance if the solution is obvious, I'm just starting with the API.