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.

compiler error
 Post subject: compiler error Post rating: 0   New post Posted: Tue 31 Jan, 2012, 15:43 
User avatar

User rating: 0
Joined: Tue 31 Jan, 2012, 15:36
Posts: 2
Location: GermanyGermany
I have an EA that I have converted to Java. If I compile the java file I get two error messages.

Incompatible operand types String and Instrument
if (tradesymbol==Instrument()){

Incompatible operand types Instrument and String
if (Instrument()==firstlegsymbol){

How can I fix the error?

Best regards Marco


 
 Post subject: Re: compiler error Post rating: 0   New post Posted: Tue 31 Jan, 2012, 16:40 
User avatar

User rating:
Joined: Fri 31 Aug, 2007, 09:17
Posts: 6139
tradesymbol.equals(Instrument().toString())


 
 Post subject: Re: compiler error Post rating: 0   New post Posted: Tue 31 Jan, 2012, 17:54 
User avatar

User rating: 0
Joined: Tue 31 Jan, 2012, 15:36
Posts: 2
Location: GermanyGermany
Ty for help...

Now i changed
if (tradesymbol==Instrument()){
in
if (tradesymbol.equals(Instrument().toString(){
and i got new errors.

Syntax error, insert ") Statement" to complete BlockStatements
if (tradesymbol.equals(Instrument().toString(){
3. ERROR in C:\Users\Marco\AppData\Local\Temp\jfxide\tmp\EA19.java (at line 211)

Syntax error, insert ")" to complete MethodInvocation
if (tradesymbol.equals(Instrument().toString(){
2. ERROR in C:\Users\Marco\AppData\Local\Temp\jfxide\tmp\EA19.java (at line 211)

Kind regards Marco


 
 Post subject: Re: compiler error Post rating: 0   New post Posted: Wed 01 Feb, 2012, 08:10 
User avatar

User rating:
Joined: Fri 31 Aug, 2007, 09:17
Posts: 6139
Please use some IDE (e.g. Eclipse and then use https://www.dukascopy.com/wiki/#Use_in_Eclipse) to avoid such syntactic errors automatically. For the particular case the message already says it all - you are missing a ")" before "{".


 

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