Hello, how to correct get array from indicator?
DateTime begin = new DateTime(time).minusWeeks(2).withDayOfWeek(DateTimeConstants.MONDAY).withTimeAtStartOfDay();
DateTime end = new DateTime(time);
List<ITick> ticks = history.getTicks(instrument, begin.getMillis(), end.getMillis());
double[] zz = indicators.zigzag(instrument, Period.TICK, OfferSide.BID, 2, 2, 0, begin.getMillis(), end.getMillis());
System.out.println("TICKS SIZE: "+ticks.size()+", zz.len: "+zz.length);
Output expected
TICKS SIZE: 689150, zz.len: 689150
but
TICKS SIZE: 689150, zz.len: 788400
I asking this question, because I need to handle zigzag WITH ticks, eg.:
for(int i=0; i<ticks.size(); i++)
if(ticks.get(i).getBid() == zz[i])
console.getOut().println("Peak found, i="+i);
I drew the ticks(blue line) and indicator(red line):
for(int i=0; i<ticks.size(); i++) {
c.add(new SimpleDateFormat("SSS ss mm HH dd MM yyyy").format(ticks.get(i).getTime()), zz[i], ticks.get(i).getBid());
So, graph looks like
