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.

multiple candles from indicator ?
 Post subject: multiple candles from indicator ? Post rating: 0   New post Posted: Mon 15 Feb, 2010, 11:52 

User rating: 0
Joined: Tue 10 Nov, 2009, 16:58
Posts: 65
I would like to use an indicator to get values for multiple candles so I tried using this

            Object[] outputs = indicators.calculateIndicator(instrument,
                                                            period,
                                                            mOfferSide,
                                                            indicatorName,
                                                            null,//mAppliedPrice,
                                                            mInputParams,
                                                            Filter.NO_FILTER,
                                                            1,
                                                            askBar.getTime(),
                                                            0);



My understanding is that I should get an array of two elements (indicator values for the last 2 candles), each element an array of values returned by the indicator (here I am using ichimoku, so there are 5 values)

The documentation says the object returned is an array of arrays. How do I access it ?
I tried this:
            Object[]first = outputs[0];
            Object[]second = outputs[1];                                                                                 



then I would access each object elements. but I get a compilation error

Type mismatch, cannot convert from Object to Object[]

How can I access the returned data ?


 
 Post subject: Re: multiple candles from indicator ? Post rating: 0   New post Posted: Mon 15 Feb, 2010, 12:16 

User rating: 0
Joined: Tue 10 Nov, 2009, 16:58
Posts: 65
I thought I just needed a cast.

Object[]first = (Object[])outputs[0];

but that gives a runtime exception too.

any ideas ?


 
 Post subject: Re: multiple candles from indicator ? Post rating: 0   New post Posted: Tue 23 Feb, 2010, 09:54 
User avatar

User rating:
Joined: Fri 31 Aug, 2007, 09:17
Posts: 6139
Consider this https://www.dukascopy.com/swiss/english/forex/jforex/forum/viewtopic.php?f=6&t=3561


 

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