Dukascopy
 
 
Wiki JStore Search Login

JFOREX-2331 : FIBPIVOT
 Post subject: JFOREX-2331 : FIBPIVOT Post rating: 0   New post Posted: Tue 02 Nov, 2010, 09:45 

User rating: 0
Joined: Fri 20 May, 2011, 17:14
Posts: 4
Location: SpainSpain
Hello,

what is correct method to call FIBPIVOT levels? Existing methods are incorrect related to actual API?

Regards.


 
 Post subject: Re: FIBPIVOT Post rating: 0   New post Posted: Sun 07 Nov, 2010, 22:43 

User rating: 0
Joined: Fri 01 Oct, 2010, 18:37
Posts: 8
I get ArrayIndexOutOfBoundsException when I call IIndicators.fibPivot(...) from strategy tester. JForex version: 2.8.1/2.6.21.

Code:
public class TestStrategy2 implements IStrategy {

   private IIndicators indicators = null;

   @Override
   public void onStart(IContext context) throws JFException {
      indicators = context.getIndicators();
   }

   @Override
   public void onTick(Instrument instrument, ITick tick) throws JFException {}

   @Override
   public void onBar(Instrument instrument, Period period, IBar askBar, IBar bidBar) throws JFException {
      indicators.fibPivot(Instrument.EURUSD, Period.ONE_HOUR, OfferSide.ASK, 5, 0);
   }

   @Override
   public void onMessage(IMessage message) throws JFException {}

   @Override
   public void onAccount(IAccount account) throws JFException {}

   @Override
   public void onStop() throws JFException {}
}

Exception:

2010-11-07 22:35:58.487 ERROR o - 1
java.lang.ArrayIndexOutOfBoundsException: 1
   at com.dukascopy.api.impl.ac.a(Unknown Source)
   at com.dukascopy.api.impl.ac.calculateIndicator(Unknown Source)
   at com.dukascopy.dds2.greed.agent.strategy.tester.al.calculateIndicator(Unknown Source)
   at com.dukascopy.api.impl.ac.fibPivot(Unknown Source)
   at jforex.contest.TestStrategy2.onBar(TestStrategy2.java:29)
   at com.dukascopy.dds2.greed.agent.strategy.tester.o.run(Unknown Source)
   at java.lang.Thread.run(Unknown Source)
Strategy tester: java.lang.ArrayIndexOutOfBoundsException: 1 @ jforex.contest.TestStrategy2.onBar(TestStrategy2.java:29)
1: java.lang.ArrayIndexOutOfBoundsException: 1
   at com.dukascopy.api.impl.ac.a(Unknown Source)
   at com.dukascopy.api.impl.ac.calculateIndicator(Unknown Source)
   at com.dukascopy.dds2.greed.agent.strategy.tester.al.calculateIndicator(Unknown Source)
   at com.dukascopy.api.impl.ac.fibPivot(Unknown Source)
   at jforex.contest.TestStrategy2.onBar(TestStrategy2.java:29)
   at com.dukascopy.dds2.greed.agent.strategy.tester.o.run(Unknown Source)
   at java.lang.Thread.run(Unknown Source)
2010-11-07 22:35:58.492 ERROR TesterClientImpl$a - Exception thrown while running onBar method: 1
java.lang.ArrayIndexOutOfBoundsException: 1
   at com.dukascopy.api.impl.ac.a(Unknown Source)
   at com.dukascopy.api.impl.ac.calculateIndicator(Unknown Source)
   at com.dukascopy.dds2.greed.agent.strategy.tester.al.calculateIndicator(Unknown Source)
   at com.dukascopy.api.impl.ac.fibPivot(Unknown Source)
   at jforex.contest.TestStrategy2.onBar(TestStrategy2.java:29)
   at com.dukascopy.dds2.greed.agent.strategy.tester.o.run(Unknown Source)
   at java.lang.Thread.run(Unknown Source)

Could you fix this bug ... or fix my code?


 
 Post subject: Re: JFOREX-2331 : FIBPIVOT Post rating: 0   New post Posted: Sun 28 Nov, 2010, 22:06 

User rating: 0
Joined: Fri 01 Oct, 2010, 18:37
Posts: 8
Is there anyone who can help with this?


 

Jump to:  

cron
  © 1998-2024 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