Dukascopy
 
 
Wiki JStore Search Login

Attention! Read the forum rules carefully before posting a topic.

    Submit JForex API bug reports in this forum only.
    Submit Converter issues in Converter Issues.
    Off topics are strictly forbidden.

Any topics which do not satisfy these rules will be deleted.

fractal indicator return empty array
 Post subject: fractal indicator return empty array Post rating: 0   New post Posted: Mon 19 May, 2014, 16:09 
User avatar

User rating: 7
Joined: Thu 05 Sep, 2013, 12:43
Posts: 56
Location: Russian Federation, Tomsk
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
DISCLAIMER: Dukascopy Bank SA's waiver of responsability - Documents, data or information available on this webpage may be posted by third parties without Dukascopy Bank SA being obliged to make any control on their content. Anyone accessing this webpage and downloading or otherwise making use of any document, data or information found on this webpage shall do it on his/her own risks without any recourse against Dukascopy Bank SA in relation thereto or for any consequences arising to him/her or any third party from the use and/or reliance on any document, data or information found on this webpage.
 
 Post subject: Re: fractal indicator return empty array Post rating: 0   New post Posted: Mon 19 May, 2014, 18:37 
User avatar

User rating: 7
Joined: Thu 05 Sep, 2013, 12:43
Posts: 56
Location: Russian Federation, Tomsk
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.


 

Jump to:  

  © 1998-2024 Dukascopy® Bank SA
On-line Currency forex trading with Swiss Forex Broker - ECN Forex Brokerage,
Managed Forex Accounts, introducing forex brokers, Currency Forex Data Feed and News
Currency Forex Trading Platform provided on-line by Dukascopy.com