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.

Indicator calling indicator produces error
 Post subject: Indicator calling indicator produces error Post rating: 0   New post Posted: Thu 25 Jun, 2015, 06:12 
User avatar

User rating: 2
Joined: Sat 02 May, 2015, 20:20
Posts: 20
Location: Ukraine, Kyiv
Hello,

Doing a simple call of a minMax indicator produces "05:04:31 Error in indicator: java.lang.NullPointerException @ com.dukascopy.indicators.ZigZagIndicator2.calculate(ZigZagIndicator2.java:100)"

The offending code is a simple call to another indicator as shown in your examples.
int shiftminmax = 1;                 
         try {
            double[] minMax = indicators.minMax(Instrument.EURUSD, Period.ONE_MIN, OfferSide.BID, AppliedPrice.CLOSE, 5, shiftminmax);
            }
            catch (Exception e) {
            icontext.getConsole().getOut().println(e);           
            }


Would like a response today if possible. thx!
TBB


Attachments:
ZigZagIndicator2.java [10.07 KiB]
Downloaded 102 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: Indicator calling indicator produces error Post rating: 0   New post Posted: Tue 30 Jun, 2015, 10:14 
User avatar

User rating:
Joined: Fri 31 Aug, 2007, 09:17
Posts: 6139
IIndicators is not available from other indicators. Please use IIndicatorProvider as described here:
https://www.dukascopy.com/wiki/#Indicator_calls_other_indicator


 
 Post subject: Re: Indicator calling indicator produces error Post rating: 0   New post Posted: Mon 06 Jul, 2015, 06:03 
User avatar

User rating: 2
Joined: Sat 02 May, 2015, 20:20
Posts: 20
Location: Ukraine, Kyiv
Ok, so if I'm using
private IBar[][] inputs = new IBar[1][];  // new code
instead of
private double[][][] inputs = new double[1][][];


How do I set the input line here?
ZZIndicator.setInputParameter(0, inputs[0][0].getClose());


This does not work and gives a runtime error.
05:02:35 Error in indicator: java.lang.ClassCastException: java.lang.Double cannot be cast to [[D @ jforex.indicators.objects.ZigZagIndicatorwithfibs.calculate(ZigZagIndicatorwithfibs.java:162)


 

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