Dukascopy
 
 
Wiki JStore Search Login

Error in indicator: java.lang.NullPointerException
 Post subject: Error in indicator: java.lang.NullPointerException Post rating: 0   New post Posted: Wed 06 Mar, 2019, 23:28 

User rating: 0
Joined: Tue 11 Oct, 2016, 16:41
Posts: 4
Can someone tell me where is the error in code on the bottom? I supose it's connected with startIndex and endIndex but I'm not sure and I don't know how to fix it.

All the time the same message: "Error in indicator: java.lang.NullPointerException"

I wanted to useichimoku indicator as a input of my own indicator, but first i wanted to check if it works, unfortunatelly it's not working :(

public IndicatorResult calculate(int startIndex, int endIndex) {
        //calculating startIndex taking into account lookback value
        if (startIndex - getLookback() < 0) {
            startIndex = getLookback();
        }
        if (endIndex + getLookforward() >= inputs[0][0].length) {
            endIndex = inputs[0][0].length - 1 - getLookforward();
        }
        if (startIndex > endIndex) {
            return new IndicatorResult(0, 0);
        }
                 
        ichi.setInputParameter(0, inputs[0]); 
       
        ichi.setOptInputParameter(0, timePeriod1);   
        ichi.setOptInputParameter(1, timePeriod2);
        ichi.setOptInputParameter(2, timePeriod3);
       
        ichi.setOutputParameter(0, outputs[0]);   
        ichi.setOutputParameter(1, outputs[1]);   
        ichi.setOutputParameter(2, outputs[2]);     
        ichi.setOutputParameter(3, outputs[3]);     
        ichi.setOutputParameter(4, outputs[4]);         
       
        ichi.calculate(startIndex, endIndex);       
               
        IndicatorResult ir = ichi.calculate(startIndex, endIndex);
       
        return ir;
    }


Attachments:
own_ichi.java [5.5 KiB]
Downloaded 148 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: Error in indicator: java.lang.NullPointerException Post rating: 0   New post Posted: Fri 08 Mar, 2019, 23:01 

User rating: 18
Joined: Thu 20 Apr, 2017, 22:42
Posts: 165
Location: Russian Federation,
Try looking for details of NullPointerException in the 'logs' folder


 
 Post subject: Re: Error in indicator: java.lang.NullPointerException Post rating: 0   New post Posted: Tue 12 Mar, 2019, 18:01 

User rating: 0
Joined: Tue 11 Oct, 2016, 16:41
Posts: 4
where can I find 'logs' folder?


 
 Post subject: Re: Error in indicator: java.lang.NullPointerException Post rating: 0   New post Posted: Thu 14 Mar, 2019, 13:12 

User rating: 18
Joined: Thu 20 Apr, 2017, 22:42
Posts: 165
Location: Russian Federation,
On windows: right click Jforex icon -> Properties ... check where it is installed. There should be subfolder named "logs"


 

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