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.compileStrategy
 Post subject: IClient.compileStrategy Post rating: 0   New post Posted: Fri 10 Aug, 2012, 10:14 
User avatar

User rating: 2
Joined: Mon 30 May, 2011, 15:41
Posts: 86
Location: Czech Republic, Prague
When I call compileStrategy from JForex-API, jfx is not created, console shows:

Compiling Strategy.java
2012-08-10 11:09:58.967 INFO JFXCompiler - Agent classpath [C:\ProgramZ\Develop\JAVA\JForexClientLibrary\libs\JForex-API-2.6.72.jar]
2012-08-10 11:09:58.967 INFO JFXCompiler - JDT classpath [C:\ProgramZ\Develop\JAVA\JForexClientLibrary\libs\ecj-3.5.2.jar]
2012-08-10 11:09:58.967 INFO JFXCompiler - Connector classpath [C:\ProgramZ\Develop\JAVA\JForexClientLibrary\libs\MQL4Connector-2.6.72.jar]

Can somebody help me? Thank you.


 
 Post subject: Re: IClient.compileStrategy Post rating: 0   New post Posted: Fri 10 Aug, 2012, 10:36 
User avatar

User rating:
Joined: Fri 31 Aug, 2007, 09:17
Posts: 6139
Please provide the example program that compiles the strategy.


 
 Post subject: Re: IClient.compileStrategy Post rating: 0   New post Posted: Fri 10 Aug, 2012, 10:58 
User avatar

User rating: 2
Joined: Mon 30 May, 2011, 15:41
Posts: 86
Location: Czech Republic, Prague
I use your JForexClientLibrary as template:

      Class<?> dcClientImpl = Thread.currentThread().getContextClassLoader().loadClass("com.dukascopy.api.impl.connect.DCClientImpl");
      client = (IClient) dcClientImpl.newInstance();
      client.connect(jnlpUrl, username, password);
      int i = 10; // wait max ten seconds
      while (i > 0 && !client.isConnected())
      {
         Thread.sleep(1000);
         i--;
      }
       client.compileStrategy( filename, true );


 
 Post subject: Re: IClient.compileStrategy Post rating: 0   New post Posted: Fri 10 Aug, 2012, 11:42 
User avatar

User rating:
Joined: Fri 31 Aug, 2007, 09:17
Posts: 6139
We support only JForex-API methods. Please take Main.java from JForexClientLibrary and add the following snippet:
https://www.dukascopy.com/wiki/#Standalone_JForex_API/Compile_a_strategy_to_a_jfx_file


 
 Post subject: Re: IClient.compileStrategy Post rating: 0   New post Posted: Fri 10 Aug, 2012, 12:07 
User avatar

User rating: 2
Joined: Mon 30 May, 2011, 15:41
Posts: 86
Location: Czech Republic, Prague
Of course, I use you JForex-API.
When I put line from your wiki to Main.java, I can't compile source:
client.compileStrategy( new File("c:\\Strategy.java"), false );

I can compile Main.java with this line:
client.compileStrategy( "c:\\Strategy.java", false );

But result is same, jfx is not created. Log output is same as previous.


 
 Post subject: Re: IClient.compileStrategy Post rating: 0   New post Posted: Wed 15 Aug, 2012, 08:03 
User avatar

User rating:
Joined: Fri 31 Aug, 2007, 09:17
Posts: 6139
Try with JForex-API 2.7


 
 Post subject: Re: IClient.compileStrategy Post rating: 0   New post Posted: Wed 15 Aug, 2012, 08:54 
User avatar

User rating: 2
Joined: Mon 30 May, 2011, 15:41
Posts: 86
Location: Czech Republic, Prague
I downloaded all newer files founded on your site, and now strategies are compiled.
Thank you for help.

dds2-common-2.3.107.jar
DDS2-Connector-1.1.53.jar
DDS2-Charts-5.69.jar
DDS2-jClient-JForex-2.18.jar
greed-common-195.jar
JForex-API-2.7.jar
JForex-SDK-2.18.jar
MQL4Connector-2.6.72.jar
MQL4Converter-1.5.jar
nlink-1.3.jar


 

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