getOptInputParameterInfo for INdi with only 1 OptInputPara
[forex451]
Post subject: getOptInputParameterInfo for INdi with only 1 OptInputPara
Post rating: 0
Posted: Fri 18 Mar, 2011, 12:42
User rating: 0
Joined: Wed 09 Mar, 2011, 10:40 Posts: 8
I'm trying to write a couple of indicators that have only one OptInputParameterInfo.
If I use an array e.g. private OptInputParameterInfo[] optInputParameterInfos;
public OptInputParameterInfo getOptInputParameterInfo(int index) { if (index <= optInputParameterInfos.length) { return optInputParameterInfos[index]; } return null; }
the code throws an exception when the indicator is attached to the chart (11:48:09 Exception while validating indicator: java.lang.ArrayIndexOutOfBoundsException: 1 @ com.dukascopy.indicators.Wave.getOptInputParameterInfo(Wave.java:112)
If I use an object e.g. private OptInputParameterInfo optInputParameterInfos;
with public OptInputParameterInfo getOptInputParameterInfo(int index) { return optInputParameterInfos; }
I get Array Index out of bounds : 1 error when the indicator is validated.
what is the recommended way of handling only one optional input parameter?
u_north
Post subject: Re: getOptInputParameterInfo for INdi with only 1 OptInputPa
Post rating: 0
Posted: Fri 18 Mar, 2011, 14:15
User rating: 0
Joined: Wed 08 Jun, 2011, 10:19 Posts: 29 Location: North Pole
Hi! Maybe numberOfOptionalInputs set to 0 in IndicatorInfo? In your case it should be equal to 1
Guest
Post subject: Re: getOptInputParameterInfo for INdi with only 1 OptInputPa
Post rating: 0
Posted: Sat 19 Mar, 2011, 01:54
User rating: -
u.north wrote:
Hi! Maybe numberOfOptionalInputs set to 0 in IndicatorInfo? In your case it should be equal to 1
Set to 1 already, so that's not the issue. But thanks!