Dukascopy
 
 
Wiki JStore Search Login

Strategy dont work
 Post subject: Strategy dont work Post rating: 0   New post Posted: Mon 01 Apr, 2013, 22:09 
User avatar

User rating: 0
Joined: Thu 16 Feb, 2012, 19:18
Posts: 15
Location: Czech Republic, Prague
can anybody help me why my strategy doesnt work please.
My strategy is made from strategy which dukascopy prepared for me and i edited.
If it must have different format or something else, can anybody help me with it?

Thanks


Attachments:
Tony_contest.java [32.44 KiB]
Downloaded 448 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: Strategy dont work Post rating: 1   New post Posted: Mon 01 Apr, 2013, 23:40 
User avatar

User rating: 8
Joined: Tue 31 Jan, 2012, 11:24
Posts: 72
Location: India, Gurgaon
There is no code to add currency pairs to trade:

Add following code in onStart method:

 Set<Instrument> instruments = new HashSet<Instrument>();
        instruments.add(Instrument.EURUSD);     
        context.setSubscribedInstruments(instruments, true);

or change your onStart method from below code of onStart Method:

Here is full code for onStart method:
 @Override
    public void onStart(IContext context) throws JFException {
        this.console = context.getConsole();
        this.indicators = context.getIndicators();
        this.history = context.getHistory();
        this.engine = context.getEngine();
        this.context = context;
       
        IChart chart = context.getChart(instrument);
        if (chart != null) {
            chart.addIndicator(indicators.getIndicator("SAR"), new Object[]{acceleration, max});
            chart.addIndicator(indicators.getIndicator("MAMA"), new Object[]{fastLimit, slowLimit});
        }
        Set<Instrument> instruments = new HashSet<Instrument>();
        instruments.add(Instrument.EURUSD);
                       
        context.setSubscribedInstruments(instruments, true);
       
       
        if(useCustomPeriod) {
            selectedPeriod = Period.createCustomPeriod(unit, unitsCount);
        }
       
        feedDescr = configureChartType(context, instrument);
       
        orderMgr = new OrderMgr(maxLongOrders, maxShortOrders, maxTotalOrders);       
       
    }


 
 Post subject: Re: Strategy dont work Post rating: 0   New post Posted: Wed 03 Apr, 2013, 00:36 
User avatar

User rating: 0
Joined: Thu 16 Feb, 2012, 19:18
Posts: 15
Location: Czech Republic, Prague
can you pls help me to edit it to strategy which will work. I am unable to edit it - i dont know where to add thing you wrote.
Thank you very much


 
 Post subject: Re: Strategy dont work Post rating: 1   New post Posted: Wed 03 Apr, 2013, 04:28 
User avatar

User rating: 8
Joined: Tue 31 Jan, 2012, 11:24
Posts: 72
Location: India, Gurgaon
Code has been updated to run it in contest account.

If you want to add multiple currencies, for that I have added example also in code and you can take help of that for multiple currencies strategy.


Attachments:
File comment: Changed for contest account
Tony_contest.java [34.25 KiB]
Downloaded 401 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: Strategy dont work Post rating: 0   New post Posted: Wed 03 Apr, 2013, 11:05 
User avatar

User rating: 0
Joined: Thu 16 Feb, 2012, 19:18
Posts: 15
Location: Czech Republic, Prague
thank you very much, i really appreciate your help


 
 Post subject: Re: Strategy dont work Post rating: 0   New post Posted: Wed 03 Apr, 2013, 21:01 
User avatar

User rating: 0
Joined: Thu 16 Feb, 2012, 19:18
Posts: 15
Location: Czech Republic, Prague
i applied strategy you edited, it is in my contest account but it still doesnt work


 
 Post subject: Re: Strategy dont work Post rating: 0   New post Posted: Wed 03 Apr, 2013, 22:39 
User avatar

User rating: 8
Joined: Tue 31 Jan, 2012, 11:24
Posts: 72
Location: India, Gurgaon
Have you tested it on demo account, or have you done historical testing?

I think, strategy is not satisfying buy/sell condition, and will look it tomorrow and then tell you.

Regards,


 
 Post subject: Re: Strategy dont work Post rating: 0   New post Posted: Wed 03 Apr, 2013, 23:28 
User avatar

User rating: 0
Joined: Thu 16 Feb, 2012, 19:18
Posts: 15
Location: Czech Republic, Prague
i was testing it on historical data.
Strategy which i firstly posted normally works on demo acc but in strategy contest it doesnt work.
I am sorry i disturb you but i dont know anything in java :(
Thanks


 
 Post subject: Re: Strategy dont work Post rating: 0   New post Posted: Thu 04 Apr, 2013, 15:51 
User avatar

User rating: 0
Joined: Thu 16 Feb, 2012, 19:18
Posts: 15
Location: Czech Republic, Prague
with my original strategy i wrote to Dukascopy support that id doesnt work and i receive this answer:
Greetings,

We recommend you to increase the logging of your strategy log and verify the situation with the logs.

Regards,
Support Team


Can you help me to solve it, please?


 

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