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.

caluculate indicator in strategy with the universal method ends in ArrayIndexOutOfBoundsExceptio
 Post subject: caluculate indicator in strategy with the universal method ends in ArrayIndexOutOfBoundsExceptio Post rating: 0   Post Posted: Wed 10 Sep, 2014, 12:01 
User avatar

User rating: 2
Joined: Wed 03 Sep, 2014, 09:11
Posts: 32
Location: GermanyGermany
Dear Supportteam,

it seems, does with Pivot indicator the universal method not work:
I get an ArrayIndexOutOfBoundsException

Please can you check this?

Many THX


        Object[] pivot = indicators.calculateIndicator(Instrument.EURUSD, Period.ONE_HOUR, new OfferSide[]{OfferSide.ASK}, "Pivot",
                new AppliedPrice[]{IIndicators.AppliedPrice.CLOSE}, new Object[]{7, false}, 0);

        console.getOut().println("first indicator value: " + ((Object[]) pivot)[0]);



 
 Post subject: Re: caluculate indicator in strategy with the universal method ends in ArrayIndexOutOfBoundsExceptio Post rating: 1   Post Posted: Thu 11 Sep, 2014, 09:55 
User avatar

User rating: 164
Joined: Mon 08 Oct, 2012, 10:35
Posts: 676
Location: NetherlandsNetherlands
Hi,

Pivot indicator doesn't use AppliedPrice.
You need only:
Instrument instrument,
Period period,
OfferSide side,
Period timePeriod,
int shift

try something like (not sure if the syntax is okay):
Object[] pivot = indicators.calculateIndicator(Instrument.EURUSD, Period.ONE_HOUR, new OfferSide[]{OfferSide.ASK}, "Pivot",            new Object[]{7}, 0);


 

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