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 use @Configurable annotation in JForex-SDK?
 Post subject: How to use @Configurable annotation in JForex-SDK? Post rating: 0   New post Posted: Mon 20 Aug, 2012, 09:11 

User rating: 0
Joined: Thu 16 Aug, 2012, 03:29
Posts: 26
Excuse me,

I was wondering whether you could tell me how to make use of @Configurable annotation in JForex-SDK.

It seems not easy to get access to these user defined parameters in JForex-SDK via user interface frame.

Would you please help me out?

Thank you so much!


 
 Post subject: Re: How to use @Configurable annotation in JForex-SDK? Post rating: 0   New post Posted: Mon 20 Aug, 2012, 10:03 
User avatar

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

Using the @Configurable annotation is very simple. You declare this annotation before the PUBLIC variable in variable area at the beginning of the strategy (the variable must be public). Some examples:
//Strategy configurable variables
    @Configurable("Instrument to use:")
    public Instrument myInstrument = Instrument.EURUSD;
    @Configurable("Period to use:")
    public Period myPeriod = Period.ONE_HOUR;
    @Configurable("Risk value (100/risk):")
    public double myRisk = 0.02;
    @Configurable("Take Profit:")
    public int myTakeProfit = 50;
    @Configurable("Stop Loss:")
    public int myStopLoss = 15;
    @Configurable("Difference Value in Pips:")
    public double myDifference = 10;
    // Time specifics (related to server time - GMT)
    @Configurable("Control time:")
    public boolean myControlTime = true;
    @Configurable("Trade weekends:")
    public boolean myTradeWeekends = false;
    @Configurable("Beggin Trade hour:")
    public int myBeginTime = 7;
    @Configurable("End trade hour")
    public int myEndTime = 21;
    // RSI Specifics
    @Configurable("RSI Min:")
    public double myRSIMin = 41.0;
    @Configurable("RSI Max:")
    public double myRSIMax = 59.0;
    @Configurable("RSI interval:")
    public int myRSIInterval = 14;
    @Configurable("Before trigger value:")
    public double myRSITrigger = -2;
    @Configurable("Order inverter")
    public boolean myOrderInverter = true;


The resulting window when strategy starts:

Image

You can read more about here.

Hope that helps

Trade well and prospers in your way

JL


Attachments:
parameters.png [74.7 KiB]
Downloaded 523 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 use @Configurable annotation in JForex-SDK? Post rating: 0   New post Posted: Wed 22 Aug, 2012, 04:29 

User rating: 0
Joined: Thu 16 Aug, 2012, 03:29
Posts: 26
Thank you very much for your reply.

However, I meant to ask how to use @Configurable annotation in JForex-SDK, which I could use Java IDE like eclipse to import the project and start programming.

As a matter of fact, I already knew how to use @Configurable annotation in JForex client。

Thank you all the same.


 
 Post subject: Re: How to use @Configurable annotation in JForex-SDK? Post rating: 0   New post Posted: Wed 22 Aug, 2012, 17:00 
User avatar

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

My apologies for the misunderstanding of your question. Using the API directly in our imlementation to show us the frame with the @Configurable parameters, i don't know if the implementation of this is builded on API itself or in JForex client itself. We can only be sure of this hacking the source code of the API or other solution is implementing a JFrame (separated window) or a JPanel (for the user interface) with the parameters we want to be available and call it to change them. Maybe Support can say anything about this.

Best regards

JL


 
The Best Answer  Post subject: Re: How to use @Configurable annotation in JForex-SDK? Post rating: 0   New post Posted: Thu 23 Aug, 2012, 15:02 
User avatar

User rating:
Joined: Fri 31 Aug, 2007, 09:17
Posts: 6139
Parameters window is available only in JForex client.


 
 Post subject: Re: How to use @Configurable annotation in JForex-SDK? Post rating: 0   New post Posted: Thu 06 Sep, 2012, 01:52 

User rating: 0
Joined: Thu 16 Aug, 2012, 03:29
Posts: 26
Thank you so much, jlongo.

I am so appreciative of your help and support.


 

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