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 to implement external java class file into a JForex strategy
 Post subject: How to implement external java class file into a JForex strategy Post rating: 0   New post Posted: Tue 21 May, 2013, 01:10 

User rating: 0
Joined: Mon 28 Jan, 2013, 22:54
Posts: 5
Location: GermanyGermany
Hello,

I am working with netbeans and I have created a strategy where I would like to enclose an external java class file. This external java class file is located in the same package and path as the strategy and contains some methods using JForex API. in NetBeans it is very simple to call it:
private myLib mylib = new myLib();

but it doesn't work in JForex. See attached files for more details.

Thank you very much in advance.

Regards, Hugoman

Image

Image


Attachments:
2013_05_21_020736.png [33.19 KiB]
Downloaded 613 times
2013_05_21_015552.png [57.72 KiB]
Downloaded 643 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: How to implement external java class file into a JForex strategy Post rating: 0   New post Posted: Tue 21 May, 2013, 01:30 
User avatar

User rating: 94
Joined: Mon 06 Feb, 2012, 12:22
Posts: 357
Location: Portugal, Castelo Branco
Hi HugoMan:

I have several articles i talk about the use of external libraries.

I have one example with javamail you can read here -> https://www.dukascopy.com/fxcomm/fx-arti ... ad&id=1239
In actual i also talk about the use of external library, but only on next one i will release the example code.

Any question, just ask

Trade well

JL


 
 Post subject: Re: How to implement external java class file into a JForex strategy Post rating: 0   New post Posted: Tue 21 May, 2013, 07:04 
User avatar

User rating:
Joined: Fri 31 Aug, 2007, 09:17
Posts: 6139
See:
https://www.dukascopy.com/wiki/#Include_libraries


 
 Post subject: Re: How to implement external java class file into a JForex strategy Post rating: 0   New post Posted: Tue 21 May, 2013, 09:35 

User rating: 0
Joined: Mon 28 Jan, 2013, 22:54
Posts: 5
Location: GermanyGermany
Hello Jlongo, hello Dukascopy Support,

thanks a lot for your fast reply. Unfortunately it is not exactly what I am looking for.

My intent is to collect often used methods / functions in a separate file / library. Those methods / functions need to have access to Dukascopy API, therefore I need to import the same. The most easiest way in NB is to create a new Java class file and to import the same into the strategy. This works fine, but not in the JForex environment (at least not as of my knowledge) :( .
Do you know, whether there is away to call / import this Java class file in JForex environment?
Please see the error message that comes up in the JForex environment during compilation in my post above

Alternatively I would use the recommended way by creating an external library as jar - file, but how to enclose / import the Dukascopy APIs into this Project?
If it would be a RAVEN - project as well (like the strategy), i cannot create a Jar - file. I am a bit lost here.

Thanks again in advance for your support.

Regards, Hugoman


 
 Post subject: Re: How to implement external java class file into a JForex strategy Post rating: 0   New post Posted: Tue 21 May, 2013, 10:53 
User avatar

User rating:
Joined: Fri 31 Aug, 2007, 09:17
Posts: 6139
Hugoman wrote:
Do you know, whether there is away to call / import this Java class file in JForex environment?
Yes, through reflection:
https://www.dukascopy.com/wiki/#Load_java_class


 

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