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.

IClient.packToJfx minimal working setup
 Post subject: IClient.packToJfx minimal working setup Post rating: 0   New post Posted: Sun 09 Jul, 2017, 07:24 
User avatar

User rating: 0
Joined: Tue 04 Sep, 2012, 06:35
Posts: 11
Location: Hungary,
Dear support, I can't seem to get the tester client to convert any strategies to .jfx files. I'm basically trying to make the minimal app which would get a jar and output a .jfx strategy. I currently have the following setup:
package JForex;

import com.dukascopy.api.system.ITesterClient;
import com.dukascopy.api.system.TesterFactory;
import java.nio.file.Paths;

public class Converter {
    public static void main(String[] args) throws Exception {

        String jnlpUrl = "https://platform.dukascopy.com/demo/jforex.jnlp";
        String userName = "foo";
        String password = "bar";
        String absolutePath = "C:\\mystrategy.jar";
        final ITesterClient client = TesterFactory.getDefaultInstance();

        client.connect(jnlpUrl, userName, password);

        //wait for it to connect
        int i = 10; //wait max ten seconds
        while (i > 0 && !client.isConnected()) {
            Thread.sleep(1000);
            i--;
        }
        if (!client.isConnected()) {
            System.exit(1);
        }

        try {
            client.packToJfx(Paths.get(absolutePath).toFile());
        } catch (Exception e) {
            e.printStackTrace();
            System.exit(1);
        }

        System.exit(0);
    }
}


Provided with a valid demo Username/pw combination, it does connect and exits with code 0, but no jfx file appears as described here. The specified Jar does have the necessary META-INF/MANIFEST.MF entry. Is there something fundamentally wrong with this approach, or is it more likely my jar? Could you please provide a minimal working proof-of-concept?
Thank you in advance!


 
 Post subject: Re: IClient.packToJfx minimal working setup Post rating: 0   New post Posted: Tue 11 Jul, 2017, 13:44 
User avatar

User rating:
Joined: Fri 31 Aug, 2007, 09:17
Posts: 6139
ITesterClient can not compile strategies. Please use IClient to do that. Note that IClient and ITesterClient cannot be called at the same time in same process.


 

Jump to:  

  © 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