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.

JFUtil an open source JForex utilities library
 Post subject: JFUtil an open source JForex utilities library Post rating: 1   Post Posted: Wed 24 Nov, 2010, 16:33 

User rating: 1
Joined: Fri 26 Mar, 2010, 19:19
Posts: 116
Location: Canada
I am sharing a library of common JForex utilities such as multi-threaded ordering, P&L calculation, rounding numbers, accessing JForex indicators, etc.

Instead of everyone re-inventing the wheel, this can save JForex strategy programmers some time and enhance the quality of each of our trading strategies by collaborating on the resuable, non-proprietary codes.

See my blog post for details on how to download or contribute to "the JFUtil open source project".

What do you think about this?

Update: March 2011, JFUtil 2.0 alpha release. JFUtil 2.0 has been redesigned from the ground up. This version incorporate your feedback from 1.0 and implements design patterns to help you achieve better manageable code.


 
 Post subject: Re: JFUtil: an open source JForex utilities library Post rating: 0   Post Posted: Wed 24 Nov, 2010, 17:11 

User rating: 1
Joined: Mon 23 May, 2011, 07:52
Posts: 57
Location: Bulgaria,
No comment quantisan,
if anyone was like you ..............
Thank you ;)


 
 Post subject: Re: JFUtil: an open source JForex utilities library Post rating: 0   Post Posted: Sat 27 Nov, 2010, 01:10 

User rating: 1
Joined: Fri 26 Mar, 2010, 19:19
Posts: 116
Location: Canada
just pushed a major update to the repository

Ordering now has multi-threaded trailing step setter, market exposure check, etc. If anything, this class is worth a look.
Some updates and fixes to the other classes as well

Next update will be to consolidate the bid and ask in Ordering to a generic submit order method


 
 Post subject: Re: JFUtil: an open source JForex utilities library Post rating: 0   Post Posted: Sun 28 Nov, 2010, 12:52 
User avatar

User rating: 5
Joined: Fri 02 Sep, 2011, 10:08
Posts: 157
Location: FranceFrance
This is a great idea and will help the JForex community grow.


 
 Post subject: Re: JFUtil: an open source JForex utilities library Post rating: 0   Post Posted: Mon 29 Nov, 2010, 04:50 
User avatar

User rating: 0
Joined: Tue 24 May, 2011, 00:41
Posts: 38
Location: United KingdomUnited Kingdom
Great update, quantisan.

Thank you so much for sharing this.


 
 Post subject: Re: JFUtil: an open source JForex utilities library Post rating: 0   Post Posted: Wed 01 Dec, 2010, 17:36 

User rating: 0
Joined: Wed 18 May, 2011, 23:26
Posts: 40
Location: Switzerland,
Good idea quantisan - will take a look.


 
 Post subject: Re: JFUtil: an open source JForex utilities library Post rating: 0   Post Posted: Sun 05 Dec, 2010, 23:04 

User rating: 1
Joined: Fri 26 Mar, 2010, 19:19
Posts: 116
Location: Canada
I updated the Ordering class for more freedom in labeling orders.


 
 Post subject: Re: JFUtil: an open source JForex utilities library Post rating: 0   Post Posted: Tue 07 Dec, 2010, 11:31 
User avatar

User rating: 0
Joined: Tue 07 Dec, 2010, 10:51
Posts: 39
quantisan wrote:
I am sharing a library of common JForex utilities such as multi-threaded ordering, P&L calculation, rounding numbers, accessing JForex indicators, etc.

Instead of everyone re-inventing the wheel, this can save JForex strategy programmers some time and enhance the quality of each of our trading strategies by collaborating on the resuable, non-proprietary codes.

See my blog post for details on how to download or contribute to "the JFUtil open source project".

What do you think about this?


Hey quantisan,

I'm new to JForex, trying to learn this but with the limited documentation and no tips while coding it gets kinda confusing at times.

Don't know if I'm blind or stupid but where is your blog?

UPDATE: Found it!

Thanks


 
 Post subject: Re: JFUtil: an open source JForex utilities library Post rating: 0   Post Posted: Thu 16 Dec, 2010, 13:40 
User avatar

User rating:
Joined: Fri 31 Aug, 2007, 09:17
Posts: 6139
May we add a link to your project to the Wiki? https://www.dukascopy.com/wiki/index.php?title=Main_Page


 
 Post subject: Re: JFUtil: an open source JForex utilities library Post rating: 0   Post Posted: Thu 16 Dec, 2010, 18:03 

User rating: 1
Joined: Fri 26 Mar, 2010, 19:19
Posts: 116
Location: Canada
Support wrote:
May we add a link to your project to the Wiki? https://www.dukascopy.com/wiki/index.php?title=Main_Page


of course!


 
 Post subject: Re: JFUtil: an open source JForex utilities library Post rating: 0   Post Posted: Mon 03 Jan, 2011, 04:11 

User rating: 0
Joined: Fri 19 Nov, 2010, 16:34
Posts: 2
Hi quantisan,

I found your utilities and they look really great.

Could you please help me with which files need to be installed where on my Mac? I couldn't find any documentation on this.

Also, how do I get JForex to add these utilities to the program?

Sorry for all the questions, but I am a Java and JForex newbie.

Thanks for all the help.


 
 Post subject: Re: JFUtil: an open source JForex utilities library Post rating: 0   Post Posted: Wed 05 Jan, 2011, 16:27 

User rating: 1
Joined: Fri 26 Mar, 2010, 19:19
Posts: 116
Location: Canada
@trixifx, make a JAR file of the library and then use @Library annotation in your strategy to import them to your strategy jfx


 
 Post subject: Re: JFUtil: an open source JForex utilities library Post rating: 0   Post Posted: Tue 22 Mar, 2011, 14:15 

User rating: 1
Joined: Fri 26 Mar, 2010, 19:19
Posts: 116
Location: Canada
I just added a feature to simplify indicator calls in IStrategy. It opens up the indicator-use design to make it more intuitive for beginners and enable runtime switching of indicators for more advanced users.

Take a look at my explanation if you're interested -- https://www.quantisan.com/conjuring-beans-to-simplify-jforex-iindicators/


 
 Post subject: Re: JFUtil: an open source JForex utilities library Post rating: 0   Post Posted: Fri 25 Mar, 2011, 17:42 

User rating: 1
Joined: Fri 26 Mar, 2010, 19:19
Posts: 116
Location: Canada
I just fixed a fatal bug in the indicatorBean abstract class. Please download JFUtil 2.1.1 for the fix.


 
 Post subject: Re: JFUtil: an open source JForex utilities library Post rating: 0   Post Posted: Mon 02 May, 2011, 11:27 

User rating: 0
Joined: Wed 27 Apr, 2011, 13:56
Posts: 18
Hello,

First of all, thank you very much for library. Where this jar should be placed so that JForex find them during compilation?


 
 Post subject: Re: JFUtil: an open source JForex utilities library Post rating: 0   Post Posted: Mon 02 May, 2011, 11:57 

User rating: 0
Joined: Wed 27 Apr, 2011, 13:56
Posts: 18
Are you sure that your code related to indicator values working? Because I constantly get NPE in the line
ema = Indicating.calculate(Instrument.EURUSD, Period.ONE_MIN,

below is the code:

// get an EMA indicator value by building an indicator bean
MovingAverage maBean = IndicatorBeanFactory.getMovingAverage();
// then sets its parameters with obvious method names
maBean.setAppliedPrice(IIndicators.AppliedPrice.MEDIAN_PRICE)
.setMAType(IIndicators.MaType.EMA).setWidth(14); // all of these
// are
// optional
// parameters
// feed the bean into a generic calculation method to get the result
double ema = 1;
try {
ema = Indicating.calculate(Instrument.EURUSD, Period.ONE_MIN,
maBean);
} catch (JFException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
console.getOut().println("value: " + ema);


 
 Post subject: Re: JFUtil: an open source JForex utilities library Post rating: 0   Post Posted: Thu 05 May, 2011, 19:42 

User rating: 0
Joined: Fri 25 Jun, 2010, 12:48
Posts: 12
Hi Quantisan,
Thanks for this useful library

Can I make use of some snippets of your code under the GPL license ?

Thanks in advance


 
 Post subject: Re: JFUtil: an open source JForex utilities library Post rating: 0   Post Posted: Sat 07 May, 2011, 03:05 

User rating: 1
Joined: Fri 26 Mar, 2010, 19:19
Posts: 116
Location: Canada
@androw, GPL sounds good


 
 Post subject: JFUtils don't work Post rating: 0   Post Posted: Thu 15 Dec, 2011, 17:58 
User avatar

User rating: 0
Joined: Thu 11 Aug, 2011, 14:18
Posts: 2
Location: Russian Federation,
Hi, just tested. When i write the following code:
    public void onStart(IContext context) throws JFException {
        JFUtils utils = context.getUtils();
        double amount1 = utils.convert(Instrument.EURUSD, Instrument.AUDCAD, 0.1);
    }

I get errors of compiler. How i can include JFUtils library? I followed this tutorial https://www.dukascopy.com/wiki/index.php?title=Main_Page and used this class https://www.dukascopy.com/client/javadoc//com/dukascopy/api/JFUtils.html


 

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