Dukascopy
 
 
Wiki JStore Search Login

Strategy can be compiled but not started in API 2.12.1
 Post subject: Strategy can be compiled but not started in API 2.12.1 Post rating: 0   New post Posted: Wed 26 Nov, 2014, 11:51 

User rating: 1
Joined: Thu 23 Feb, 2012, 16:38
Posts: 44
The folowing example can be compiled, but not started with the new API

package jforex;

import java.util.*;

import com.dukascopy.api.*;
import com.dukascopy.api.feed.util.TicksFeedDescriptor;
import com.dukascopy.api.feed.IFeedDescriptor;
import com.dukascopy.api.feed.IFeedListener;

public class TestStrategy implements IStrategy,IFeedListener {
    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();
        IFeedDescriptor fd = new TicksFeedDescriptor(Instrument.EURUSD);
        this.context.subscribeToFeed(fd,this);
    }
   
    public void onFeedData(IFeedDescriptor fd, ITimedData data) {
       
    }

    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 {
    }
}


Error message when starting is:
26.11.2014 11:47:58.521   SEVERE                           agent.o$b ] Exception thrown while running onStart method: Params are not correctly set - feedDescriptor=FeedDescriptor [dataType=TICKS, instrument=EUR/USD, period=Ticks, ] listener=com.dukascopy.api.impl.connect.bi@4711bac2 instrument=EUR/USD period=Ticks offerSide=null
java.lang.IllegalArgumentException: Params are not correctly set - feedDescriptor=FeedDescriptor [dataType=TICKS, instrument=EUR/USD, period=Ticks, ] listener=com.dukascopy.api.impl.connect.bi@4711bac2 instrument=EUR/USD period=Ticks offerSide=null
   at com.dukascopy.dds2.greed.agent.strategy.a.b.a(Unknown Source)
   at com.dukascopy.dds2.greed.agent.strategy.a.b.a(Unknown Source)
   at com.dukascopy.api.impl.connect.bj.run(Unknown Source)
   at java.security.AccessController.doPrivileged(Native Method)
   at com.dukascopy.api.impl.connect.av.subscribeToTicksFeed(Unknown Source)
   at com.dukascopy.api.impl.connect.av.a(Unknown Source)
   at com.dukascopy.api.impl.connect.av.subscribeToFeed(Unknown Source)
   at jforex.TestStrategy.onStart(TestStrategy.java:26)
   at com.dukascopy.api.impl.execution.u.call(Unknown Source)
   at com.dukascopy.api.impl.execution.u.call(Unknown Source)
   at com.dukascopy.api.impl.connect.ao.a(Unknown Source)
   at com.dukascopy.api.impl.connect.bz.bO(Unknown Source)
   at com.dukascopy.api.impl.connect.bz.call(Unknown Source)
   at com.dukascopy.api.impl.execution.k.call(Unknown Source)
   at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
   at java.util.concurrent.FutureTask.run(FutureTask.java:166)
   at com.dukascopy.api.impl.execution.g$a.f(Unknown Source)
   at com.dukascopy.api.impl.execution.g$a.run(Unknown Source)
   at java.lang.Thread.run(Thread.java:724)


 
 Post subject: Re: Strategy can be compiled but not started in API 2.12.1 Post rating: 0   New post Posted: Wed 26 Nov, 2014, 15:42 

User rating: 1
Joined: Thu 23 Feb, 2012, 16:38
Posts: 44
Can you please provide a quick solution for this problem as I am not able to start any strategy or show me a way how I can downgrade JForex to the last version.


 
 Post subject: Re: Strategy can be compiled but not started in API 2.12.1 Post rating: 0   New post Posted: Thu 27 Nov, 2014, 23:02 
User avatar

User rating: 8
Joined: Mon 09 Jun, 2014, 21:07
Posts: 49
Location: Poland, Warsaw
Hi,

I get exactly the same exceptions with some of my strategies.

Morover, after new DEMO version was release, some my products, like smartFX Trader and JForex to JForex copy tool, stopped working on Demo 2.12.1 (2.42.2) but work totally fine on LIVE where the version is different 2.11(2.41.5).

Could you please investigate and provide soultion?!
Grzegorz


 
 Post subject: Re: Strategy can be compiled but not started in API 2.12.1 Post rating: 1   New post Posted: Fri 28 Nov, 2014, 13:55 

User rating: 1
Joined: Thu 23 Feb, 2012, 16:38
Posts: 44
@Support: Could you at least update the docs on https://www.dukascopy.com/client/javadoc/ to the current version.
Releasing a new version with changes in the API, without any hint and documentation is not very user friendly!


 
 Post subject: Re: Strategy can be compiled but not started in API 2.12.1 Post rating: 0   New post Posted: Tue 02 Dec, 2014, 09:44 
User avatar

User rating:
Joined: Fri 31 Aug, 2007, 09:17
Posts: 6139
We are working on it, new version with fix will be available very soon.
Javadoc was updated yesterday.


 

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