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.

How compile .JFX in Eclipse?
 Post subject: How compile .JFX in Eclipse? Post rating: 0   New post Posted: Tue 17 Nov, 2009, 12:29 

User rating: 0
Joined: Sun 08 Mar, 2009, 16:42
Posts: 3
Please help. I'm using Eclipse. How i'm may compiled java file to .JFX for using with JForex?


 
 Post subject: Re: How compile .JFX in Eclipse? Post rating: 0   New post Posted: Tue 17 Nov, 2009, 15:17 
User avatar

User rating:
Joined: Fri 31 Aug, 2007, 09:17
Posts: 6139
Hi,
it's not possible to compile a java file to the jfx using Eclipse.
It can be compiled in the JForex platform only.


 
 Post subject: Re: How compile .JFX in Eclipse? Post rating: 0   New post Posted: Tue 17 Nov, 2009, 16:20 

User rating: 0
Joined: Sun 08 Mar, 2009, 16:42
Posts: 3
Support wrote:
Hi,
it's not possible to compile a java file to the jfx using Eclipse.
It can be compiled in the JForex platform only.


Then please explain how compile next task.

I'm have main program - "MainBody.java"
Fragment of code:
    public void onTick(Instrument instrument, ITick tick) throws JFException {
                Pair pair;
            }


And have - "Pair.java"
Fragment of code:
package test;

public abstract class Pair {
   public abstract boolean tradeFlagBuy();
   public abstract boolean tradeFlagSell();
   public abstract int readme();
         }



How compile "MainBody.java" in JForex platform with including "Pair.java" class?


 
 Post subject: Re: How compile .JFX in Eclipse? Post rating: 0   New post Posted: Tue 17 Nov, 2009, 18:27 
User avatar

User rating:
Joined: Fri 31 Aug, 2007, 09:17
Posts: 6139
One of the ways how to solve this problem is to use inner class.
Please consider this example:
package jforex;
import com.dukascopy.api.*;
public class Strategy implements IStrategy {

   public void onStart(IContext context) throws JFException {
   }
   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 {
            Pair pair;
        }
        public void onBar(Instrument instrument, Period period, IBar askBar, IBar bidBar) throws JFException {
        }
   
    //create inner class
    abstract class Pair {
       public abstract boolean tradeFlagBuy();
       public abstract boolean tradeFlagSell();
       public abstract int readme();
    }
}

Here is more on inner classes https://java.sun.com/docs/books/tutorial/java/javaOO/nested.html

The another way is to put your classes in jar file. Then you could load them using annotation @Library
Here is sample: https://www.dukascopy.com/swiss/english/forex/jforex/forum/viewtopic.php?f=5&t=142
and some useful info https://www.dukascopy.com/swiss/english/forex/jforex/forum/viewtopic.php?f=5&t=477&p=1427&hilit=Library#p1427


 

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