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.

Compile / Run Inside JForex ...
 Post subject: Compile / Run Inside JForex ... Post rating: 0   New post Posted: Thu 10 Nov, 2011, 16:38 

User rating: 2
Joined: Tue 08 Nov, 2011, 15:23
Posts: 29
Location: Slovenia,
Bellow example can not be compiled:
https://www.dukascopy.com/wiki/index.php ... _in_JForex

Error:
15:32:48 ----------
15:32:48 con cannot be resolved
15:32:48 ^^^
15:32:48 con.getOut().println(instr+" "+tick.getAsk()+"/"+tick.getBid());
15:32:48 4. ERROR in C:\DOCUME~1\LOCALS~1\Temp\jfxide\tmp\BasicStrategy.java (at line 24)
15:32:48 ----------
15:32:48 con cannot be resolved or is not a field
15:32:48 ^^^
15:32:48 this.con = context.getConsole();
15:32:48 3. ERROR in C:\DOCUME~1\LOCALS~1\Temp\jfxide\tmp\BasicStrategy.java (at line 11)
15:32:48 ----------
15:32:48 Syntax error on token "con", delete this token
15:32:48 ^^^
15:32:48 private IConsole console con = null;
15:32:48 2. ERROR in C:\DOCUME~1\LOCALS~1\Temp\jfxide\tmp\BasicStrategy.java (at line 5)
15:32:48 ----------
15:32:48 The public type Strategy1 must be defined in its own file
15:32:48 ^^^^^^^^^
15:32:48 public class Strategy1 implements IStrategy {
15:32:48 1. ERROR in C:\DOCUME~1\LOCALS~1\Temp\jfxide\tmp\BasicStrategy.java (at line 4)
15:32:48 ----------
15:32:46 Compiling BasicStrategy.java

Look attached file ..


Attachments:
BasicStrategy.java [794 Bytes]
Downloaded 281 times
BasicStrategy.java [794 Bytes]
Downloaded 276 times
DISCLAIMER: Dukascopy Bank SA's waiver of responsability - Documents, data or information available on this webpage may be posted by third parties without Dukascopy Bank SA being obliged to make any control on their content. Anyone accessing this webpage and downloading or otherwise making use of any document, data or information found on this webpage shall do it on his/her own risks without any recourse against Dukascopy Bank SA in relation thereto or for any consequences arising to him/her or any third party from the use and/or reliance on any document, data or information found on this webpage.
 
 Post subject: Re: Compile / Run Inside JForex ... Post rating: 0   New post Posted: Thu 10 Nov, 2011, 16:43 
User avatar

User rating:
Joined: Fri 31 Aug, 2007, 09:17
Posts: 6139
Java class name and file names should match. If you rename the file you should also rename the file.


 
 Post subject: Re: Compile / Run Inside JForex ... Post rating: 0   New post Posted: Fri 11 Nov, 2011, 15:44 

User rating: 2
Joined: Tue 08 Nov, 2011, 15:23
Posts: 29
Location: Slovenia,
I have renamed the following line:
public class BasicStrategy implements IStrategy {
private IConsole console con = null;

but I am still geting error:

2011-11-11 14:41:39 con cannot be resolved
2011-11-11 14:41:39 ^^^
2011-11-11 14:41:39 con.getOut().println(instr+" "+tick.getAsk()+"/"+tick.getBid());
2011-11-11 14:41:39 3. ERROR in C:\DOCUME~1\LOCALS~1\Temp\jfxide\tmp\BasicStrategy.java (at line 24)
2011-11-11 14:41:39 ----------
2011-11-11 14:41:39 con cannot be resolved or is not a field
2011-11-11 14:41:39 ^^^
2011-11-11 14:41:39 this.con = context.getConsole();
2011-11-11 14:41:39 2. ERROR in C:\DOCUME~1\LOCALS~1\Temp\jfxide\tmp\BasicStrategy.java (at line 11)
2011-11-11 14:41:39 ----------
2011-11-11 14:41:39 Syntax error on token "con", delete this token
2011-11-11 14:41:39 ^^^
2011-11-11 14:41:39 private IConsole console con = null;
2011-11-11 14:41:39 1. ERROR in C:\DOCUME~1\LOCALS~1\Temp\jfxide\tmp\BasicStrategy.java (at line 5)
2011-11-11 14:41:39 ----------


Attachments:
BasicStrategy.java [798 Bytes]
Downloaded 268 times
DISCLAIMER: Dukascopy Bank SA's waiver of responsability - Documents, data or information available on this webpage may be posted by third parties without Dukascopy Bank SA being obliged to make any control on their content. Anyone accessing this webpage and downloading or otherwise making use of any document, data or information found on this webpage shall do it on his/her own risks without any recourse against Dukascopy Bank SA in relation thereto or for any consequences arising to him/her or any third party from the use and/or reliance on any document, data or information found on this webpage.
 
 Post subject: Re: Compile / Run Inside JForex ... Post rating: 0   New post Posted: Fri 11 Nov, 2011, 16:11 
User avatar

User rating:
Joined: Fri 31 Aug, 2007, 09:17
Posts: 6139
Change the line:
private IConsole console con = null;
to
private IConsole con = null;
In order to avoid such compile-time errors, consider using some java IDE for writing and modifying strategies, e.g., Eclipse:
https://www.eclipse.org/downloads/packag ... /indigosr1


 

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