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.

getOptInputParameterInfo for INdi with only 1 OptInputPara
 Post subject: getOptInputParameterInfo for INdi with only 1 OptInputPara Post rating: 0   New post 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?


 
 Post subject: Re: getOptInputParameterInfo for INdi with only 1 OptInputPa Post rating: 0   New post 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


 
 Post subject: Re: getOptInputParameterInfo for INdi with only 1 OptInputPa Post rating: 0   New post 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!


 

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