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.

Missing source/documentation for calculating WILLR
 Post subject: Missing source/documentation for calculating WILLR Post rating: 0   New post Posted: Sun 26 Jun, 2011, 22:13 

User rating: 0
Joined: Wed 15 Jun, 2011, 10:28
Posts: 5
Location: ID
Hello, I've just been banging my head
over how to calculate Williams Perfect Range (WILLR):

private IBar[][] inputs = new IBar[1][];

wpr = new Object[endIndex - startIndex + 2 + iWPR.getLookback()];
iWPR.setInputParameter(0, inputs[0]);
iWPR.setOptInputParameter(0, periods);
iWPR.setOutputParameter(0, wpr);
IndicatorResult wprResult = iWPR.calculate(startIndex, endIndex);

When I try to run it, I get the error:
2011-06-26 21:11:57 Error in indicator: java.lang.ClassCastException: [Lcom.dukascopy.charts.data.datacache.l; cannot be cast to [[D @ JemmyWPR.calculate(JemmyWPR.java:76)

There is no source code and documentation, which gives me a hint how
to use the indicator properly.
I even tried to decompile some of the jforex classes, in order to understand
how to use that class with no notable success so far.

Unfortunately the indicator is not included in the sources file.
Please help!


 
 Post subject: Re: Missing source/documentation for calculating WILLR Post rating: 0   New post Posted: Mon 27 Jun, 2011, 08:29 
User avatar

User rating:
Joined: Fri 31 Aug, 2007, 09:17
Posts: 6139
Try changing the input type as follows:
  private double[][][] inputs = new double[1][][];
  ...
  inputParameterInfos = new InputParameterInfo[] {new InputParameterInfo("Input", InputParameterInfo.Type.PRICE)};
  ...
  iWPR.setInputParameter(0, inputs[0]);
  ...


 

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