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.

indicators.alligator returns null values
 Post subject: indicators.alligator returns null values Post rating: 0   New post Posted: Mon 29 May, 2017, 20:38 
User avatar

User rating: 0
Joined: Tue 08 Apr, 2014, 15:03
Posts: 7
Location: GermanyGermany
I could not help but notice a strange behaviour while running a jforex local strategy.
The local strategy sometimes crashes with values returned by the alligator, since it seemingly returns an array of null. The basic code is as follows

public void onBar(Instrument instrument, Period period, IBar askBar, IBar bidBar) throws JFException {
  if (period == Period.FIVE_MINS && instrument == Instrument.EURUSD ){
      double[] resultAlligator = indicators.alligator(instrument,period, OfferSide.BID, IIndicators.AppliedPrice.CLOSE,13, 8, 5, 0);
      BigDecimal alli1;
      BigDecimal alli2;
      BigDecimal alli3;
      try{
            alli1 = new BigDecimal(result[0]);
            alli2 = new BigDecimal(result[1]);
            alli3 = new BigDecimal(result[2]);
      }
       catch (java.lang.NumberFormatException e){
          console.getOut().println( "java.lang.NumberormatException: " +result[0] +" " +result[1] +" " + result[2] );
          return false;
      }
//do something else
      }
}


This will log:
Quote:
04:30:01 java.lang.NumberormatException: NaN NaN NaN
04:35:00 java.lang.NumberormatException: NaN NaN NaN

and so on

this happens on the live environment, but only with a live run overnight. The historic tester does not show this behaviour.
If it occured, restarting the strategy does not help, but it will run as expected when the jforex client is stopped and restartet


 
 Post subject: Re: indicators.alligator returns null values Post rating: 0   New post Posted: Thu 08 Jun, 2017, 20:45 
User avatar

User rating: 0
Joined: Tue 08 Apr, 2014, 15:03
Posts: 7
Location: GermanyGermany
Additionally, this happens only on a local run, the first occurance is always the first 5min Tick after midnight.
It does not occur on a remote run


 

Jump to:  

cron
  © 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