Dukascopy
 
 
Wiki JStore Search Login

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

    Try to find an answer in Wiki before asking a question.
    Submit programming questions in this forum only.
    Off topics are strictly forbidden.

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

Fractal indicators always return NaN
 Post subject: Fractal indicators always return NaN Post rating: 0   New post Posted: Sat 24 Aug, 2013, 13:16 
User avatar

User rating: 0
Joined: Sun 04 Aug, 2013, 10:16
Posts: 48
Location: FranceFrance
Hi,
Sorry for a total newbie question but what am I doing wrong/missing here ?

 public void onBar(Instrument instrument, Period period, IBar askBar, IBar bidBar) throws JFException {
               
      if (selectedInstrument.equals(instrument) && period.equals(setPeriod)) {

               double[] fractal = indicators.fractal(instrument, period, OfferSide.BID, 2, 1) ;

          console.getOut().println(" 0 :"+fractal[0]+" / 1 :"+fractal[1]);
        
}


console :

Quote:

0 :NaN / 1 :NaN
0 :NaN / 1 :NaN
0 :NaN / 1 :NaN
0 :NaN / 1 :NaN
0 :NaN / 1 :NaN
0 :NaN / 1 :NaN
0 :NaN / 1 :NaN
0 :NaN / 1 :NaN
0 :NaN / 1 :NaN
0 :NaN / 1 :NaN
...etc


(in testing mode if I had fractal indicator, with 2 bars on the side, on the chart opened by the tester it does show plenty of arrows)


 
 Post subject: Re: Fractal indicators always return NaN Post rating: 0   New post Posted: Sat 24 Aug, 2013, 13:33 
User avatar

User rating: 0
Joined: Sun 04 Aug, 2013, 10:16
Posts: 48
Location: FranceFrance
Is it that shift should be at least equal to the number of bars on the side ( so the fractal can be calculated) ?

edit nevermind figured it out


 

Jump to:  

  © 1998-2025 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