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.

Help with null pointer exception when changing input types
 Post subject: Help with null pointer exception when changing input types Post rating: 0   New post Posted: Mon 13 Jun, 2011, 03:17 

User rating: 0
Joined: Fri 10 Jun, 2011, 14:54
Posts: 11
Location: United States,
I'm new to Java, so I'm starting slow, working piece by piece. I tried to change the simple indicator using the pre-made code to use the PRICE input type and I got this error.

00:39:11 Error in indicator: java.lang.NullPointerException @ jforex.Indicator2.calculate(Indicator2.java:33)

These are the only changes I made to the simple indicator.

Line 10: Changed from "new double[1][]" to "new double[5][]"
Line 17: Changed to PRICE type
Line 33: Changed "inputs[0][i - k];" to "inputs[1][i - k];"
Line 74: Changed to "double[][] inputs = (double[][]) array;" which I got from another thread

What do I need to do to get this to work the same way as the default simple indicator works but using the PRICE type?


 
 Post subject: Re: Help with null pointer exception when changing input typ Post rating: 0   New post Posted: Mon 13 Jun, 2011, 15:39 
User avatar

User rating:
Joined: Fri 31 Aug, 2007, 09:17
Posts: 6139
Essentially InputParameterInfo.Type.PRICE is an array of type double[][] whereas InputParameterInfo.Type.DOUBLE is of type double[]. See:
https://www.dukascopy.com/wiki/index.php ... ameterInfo
For a simple indicator with InputParameterInfo.Type.PRICE see:
viewtopic.php?f=52&t=34656


 

Jump to:  

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