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.

using calculateindicator
 Post subject: using calculateindicator Post rating: 0   New post Posted: Sun 12 Dec, 2010, 13:15 
User avatar

User rating: 1
Joined: Tue 28 Jun, 2011, 20:38
Posts: 18
Location: United StatesUnited States
Hi:

I want to use VOLUMEWAP indicator but when running the application it throws


12:09:31 Strategy tester: java.lang.ArrayIndexOutOfBoundsException: 1 @ jforex.RizHed_VWAP.isBuySignal(RizHed_VWAP.java:413)

The code compiles and is:

Object[] VWAP = indicators.calculateIndicator(instrument,
Period.DAILY,
new OfferSide[] {OfferSide.BID},
"VOLUMEWAP",
new IIndicators.AppliedPrice[] {IIndicators.AppliedPrice.CLOSE},
new Object[]{0},
0);


Basically I just want to use the the price calculated VWAP but I dont seem to get around the interface.

Any help appreciated.

Thank you


 
 Post subject: Re: using calculateindicator Post rating: 0   New post Posted: Tue 14 Dec, 2010, 10:37 
User avatar

User rating:
Joined: Fri 31 Aug, 2007, 09:17
Posts: 6139
Hi,
Two things: you have to set the offer side of the second input and change the value of the optional parameter (the minimum value of time period in VOLUMEWAP indicator is 2).
Object[] VWAP = indicators.calculateIndicator(instrument, Period.DAILY, 
        new OfferSide[] {OfferSide.BID, OfferSide.BID},"VOLUMEWAP",
        new IIndicators.AppliedPrice[] {IIndicators.AppliedPrice.CLOSE, IIndicators.AppliedPrice.CLOSE}, new Object[]{2}, 0);

Also, you might find the following JForex Wiki article useful: https://www.dukascopy.com/wiki/index.php ... Indicators


 

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