Dukascopy Support Board
http://www.dukascopy.com/swiss/english/forex/jforex/forum/

fractal indicator return empty array
http://www.dukascopy.com/swiss/english/forex/jforex/forum/viewtopic.php?f=16&t=51268
Page 1 of 1

Author:  fxdiler [ Mon 19 May, 2014, 16:09 ]
Post subject:  fractal indicator return empty array

Hello,

There is a code
double[][] fractals = indicators.fractal(instrument, period, OfferSide.BID, barsOnSides, Filter.WEEKENDS,
                    100, bar.getTime() - (barsOnSides - 1) * period.getInterval(), 0);
console.getOut().format("length=%d  0th=%s", fractals[0].length, Arrays.toString(fractals[0])).println();
console.getOut().format("length=%d  1th=%s", fractals[1].length, Arrays.toString(fractals[1])).println();

When period is 4 hours and barsOnSides = 5 strategy output is
length=10  1th=[NaN, 1.36484, NaN, NaN, NaN, NaN, NaN, NaN, NaN, NaN]
length=10  0th=[NaN, 1.37322, NaN, NaN, NaN, NaN, NaN, NaN, NaN, NaN]

But when period is 4 hours and barsOnSides = 6 or more strategy output is
length=0  1th=[]
length=0  0th=[]

Is there a bug in fractal indicator?

Attachments:
FractalEmptyResult.java [1.75 KiB]
Downloaded 94 times

Author:  fxdiler [ Mon 19 May, 2014, 18:37 ]
Post subject:  Re: fractal indicator return empty array

I solve the problem.
The problem code was
IBar bar = history.getBar(instrument, period, OfferSide.BID, 1);

It ignores the flat filtering on weekends.

The topic can be closed.

  Page 1 of 1