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.

can't initialize variable
 Post subject: can't initialize variable Post rating: 0   New post Posted: Fri 17 Sep, 2010, 09:59 

User rating: 0
Joined: Fri 20 Aug, 2010, 14:09
Posts: 20
The line:
DefaultCategoryDataset dataset = new DefaultCategoryDataset();


is stopping the strategy. What is wrong? (you can get the jar file here: https://www.jfree.org/jfreechart/)

package jforex;

import java.util.*;

import com.dukascopy.api.*;

import org.jfree.data.category.DefaultCategoryDataset;

@RequiresFullAccess
@Library("../JForex/Strategies/files/jfreechart-1.0.13.jar")

public class Dataset implements IStrategy {
   private IEngine engine;
   private IConsole console;
   private IHistory history;
   private IContext context;
   private IIndicators indicators;
   private IUserInterface userInterface;
   
   public void onStart(IContext context) throws JFException {
      this.engine = context.getEngine();
      this.console = context.getConsole();
      this.history = context.getHistory();
      this.context = context;
      this.indicators = context.getIndicators();
      this.userInterface = context.getUserInterface();
       
        DefaultCategoryDataset dataset = new DefaultCategoryDataset();
   }

   public void onAccount(IAccount account) throws JFException {
   }

   public void onMessage(IMessage message) throws JFException {
   }

   public void onStop() throws JFException {
   }

   public void onTick(Instrument instrument, ITick tick) throws JFException {
   }
   
    public void onBar(Instrument instrument, Period period, IBar askBar, IBar bidBar) throws JFException {
    }
}


 
 Post subject: Re: can't initialize variable Post rating: 0   New post Posted: Fri 17 Sep, 2010, 13:33 
User avatar

User rating:
Joined: Fri 31 Aug, 2007, 09:17
Posts: 6139
Hi,
It seems to be the third party software. Please contact the developers of this software.


 
 Post subject: Re: can't initialize variable Post rating: 0   New post Posted: Mon 20 Sep, 2010, 09:28 

User rating: 0
Joined: Fri 20 Aug, 2010, 14:09
Posts: 20
Could you give it another try? JFreechart has been stable since April 2009 and this is the basic to be able to create a dataset. The examples work when you try them locally but fail once included in JForex.

Also it seems more logical for Dukascopy to fix it since JFreechart is open source and JForex is not and is not giving any errors at all. So you can dive deep while others cannot.

thx


 
 Post subject: Re: can't initialize variable Post rating: 0   New post Posted: Mon 27 Sep, 2010, 07:50 

User rating: 0
Joined: Fri 20 Aug, 2010, 14:09
Posts: 20
Any status update?


 
 Post subject: Re: can't initialize variable Post rating: 0   New post Posted: Mon 27 Sep, 2010, 16:16 
User avatar

User rating:
Joined: Fri 31 Aug, 2007, 09:17
Posts: 6139
It is necessary to include jcommon jar when you use the JFreeChart library. Please take a look at the following JForex Wiki page https://www.dukascopy.com/wiki/index.php ... _libraries


 

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