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.

XAGUSD strategy
 Post subject: XAGUSD strategy Post rating: 0   New post Posted: Thu 16 Jun, 2011, 08:17 

User rating: 0
Joined: Thu 16 Jun, 2011, 08:14
Posts: 6
Location: Switzerland,
The tester doe snot seem to work with XAGUSD pair. It just sits there and refuses to start.

Specific question: what is the IEngine.submitOrder() amount parameter in the case of XAGUSD or XAUUSD ? For currencies, it is expressed in millions of the base currency. For the metal pairs, what is it ounces ? millions of ounces ?


 
 Post subject: Re: XAGUSD strategy Post rating: 0   New post Posted: Thu 16 Jun, 2011, 09:18 
User avatar

User rating:
Joined: Fri 31 Aug, 2007, 09:17
Posts: 6139
brainstorm wrote:
The tester doe snot seem to work with XAGUSD pair. It just sits there and refuses to start.
Make sure that you have selected the instrument XAGUSD in Historical Data panel. If you still encounter some problems, please provide some more details of your Historical Tester settings and some fragment of the strategy that you try to run.
brainstorm wrote:
Specific question: what is the IEngine.submitOrder() amount parameter in the case of XAGUSD or XAUUSD ? For currencies, it is expressed in millions of the base currency. For the metal pairs, what is it ounces ? millions of ounces ?
It is always in millions - in this case - millions of ounces. Mind that minimal amount for XAGUSD is 50 units.


 
 Post subject: Re: XAGUSD strategy Post rating: 0   New post Posted: Thu 16 Jun, 2011, 12:12 

User rating: 0
Joined: Thu 16 Jun, 2011, 08:14
Posts: 6
Location: Switzerland,
Support wrote:
brainstorm wrote:
The tester doe snot seem to work with XAGUSD pair. It just sits there and refuses to start.
Make sure that you have selected the instrument XAGUSD in Historical Data panel. If you still encounter some problems, please provide some more details of your Historical Tester settings and some fragment of the strategy that you try to run.


The strategy works just fine with every OTHER currency pair. So yes I can confirm I selected XAGUSD when running the tester as that is the only one that does not actually start the tester. Point is, I don't even get a message that I output in the onStart() method, nothing.

I even just tried with a totally new, empty strategy. In JForex create a new strategy, then add a this.console.getOut().println("test message") to onStart(). Nothing happens, the tester does not run when I click "start". Just a blank chart comes up. And there is no "test message" in the output window. Yes, I enabled "Messages" in the tester. If I instead select another currency pair, it happily displays the chart and the message. I tried this with data from the last week.

Support wrote:
brainstorm wrote:
Specific question: what is the IEngine.submitOrder() amount parameter in the case of XAGUSD or XAUUSD ? For currencies, it is expressed in millions of the base currency. For the metal pairs, what is it ounces ? millions of ounces ?
It is always in millions - in this case - millions of ounces. Mind that minimal amount for XAGUSD is 50 units.

thanks. good to know !


 
 Post subject: Re: XAGUSD strategy Post rating: 0   New post Posted: Thu 16 Jun, 2011, 13:04 
User avatar

User rating:
Joined: Fri 31 Aug, 2007, 09:17
Posts: 6139
Could you please check if this strategy gives no results or outputs too? If so, could you please provide a screenshot of your Historical Tester tab?
package jforex.strategies.oneorder;

import java.text.SimpleDateFormat;
import java.util.TimeZone;

import com.dukascopy.api.*;

public class OneOrderXAG implements IStrategy {
   
    private IEngine engine;
    private IConsole console;
    private IOrder order;
    private SimpleDateFormat sdf;
   
    private Instrument instrument = Instrument.XAGUSD;
   
    public void onStart(IContext context) throws JFException {
        engine = context.getEngine();
        console = context.getConsole();
        sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss") {{setTimeZone(TimeZone.getTimeZone("GMT"));}};
       
        context.getConsole().getOut().println("Start");
        order = engine.submitOrder("orderXAGUSD", instrument, IEngine.OrderCommand.BUY, 0.001);
    }

    public void onTick(Instrument instrument, ITick tick) throws JFException {
    }
   
    public void onBar(Instrument instrument, Period period, IBar askBar, IBar bidBar) throws JFException {
        if(!period.equals(Period.ONE_HOUR) || !(instrument.equals(this.instrument))) return;
        console.getOut().println(sdf.format(bidBar.getTime()) + " " +order.getLabel() + " - " + order.getState() + " ask volume: " + askBar.getVolume() + " instrument: " + instrument);
    }
   
    public void onMessage(IMessage message) throws JFException {
        console.getOut().println(message.getContent());
    }
   
    public void onAccount(IAccount account) throws JFException {}
   
    public void onStop() throws JFException {
        for(IOrder o: engine.getOrders()) o.close();
        }

}


 
 Post subject: Re: XAGUSD strategy Post rating: 0   New post Posted: Thu 16 Jun, 2011, 15:22 

User rating: 0
Joined: Thu 16 Jun, 2011, 08:14
Posts: 6
Location: Switzerland,
Support wrote:
Could you please check if this strategy gives no results or outputs too? If so, could you please provide a screenshot of your Historical Tester tab?



absolutely the same behavior. screenshot attached.


Attachments:
Screen shot 2011-06-16 at 4.20.59 PM.png [61.27 KiB]
Downloaded 548 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: XAGUSD strategy Post rating: 0   New post Posted: Fri 17 Jun, 2011, 16:55 
User avatar

User rating:
Joined: Fri 31 Aug, 2007, 09:17
Posts: 6139
Please check the issue on a new build.


 
 Post subject: Re: XAGUSD strategy Post rating: 0   New post Posted: Fri 09 May, 2014, 11:18 

User rating: 0
Joined: Fri 09 May, 2014, 09:05
Posts: 5
Location: Germany,
This is still not working correctly! Especially the year 2011 seems to have problems. The strategy is stalled in "Creating data loading threads".

Steps to reproduce:
- Remove ~/JForex directory
- Start JForex demo
- Take suggested strategy from this thread
- Start backtesting from 1.1.2011 to 1.1.2012, XAGUSD, Ticks, All Ticks
- Wait

Further observations:
$ cd ~/JForex/.cache/XAGUSD
$ du -s *
28   1999
28   2000
28   2001
28   2002
380   2003
556   2004
548   2005
548   2006
548   2007
556   2008
548   2009
760   2010
234276   2011
556   2012
24564   2013
12116   2014
104   intraperiod


Why does it download data for 2013, when the requested range is 1.1.2011 to 1.1.2012?

$ cd ~/JForex/.cache/XAGUSD/2011
$ du -s *
940   00
2488   01
13876   02
21512   03
30656   04
24068   05
21536   06
27168   07
28000   08
22756   09
22096   10
19152   11
12   ASK_candles_day_1.bi5
12   BID_candles_day_1.bi5

Why is there so less data for jan and feb?

Please investigate this! Thanks


 
 Post subject: Re: XAGUSD strategy Post rating: 0   New post Posted: Fri 16 May, 2014, 09:23 
User avatar

User rating:
Joined: Fri 31 Aug, 2007, 09:17
Posts: 6139
Cosmo wrote:
Especially the year 2011 seems to have problems. The strategy is stalled in "Creating data loading threads".
What messages do you get in java console? See:
viewtopic.php?f=81&t=39073


 
 Post subject: Re: XAGUSD strategy Post rating: 0   New post Posted: Wed 21 May, 2014, 18:08 

User rating: 0
Joined: Fri 09 May, 2014, 09:05
Posts: 5
Location: Germany,
21.05.2014 19:05:42.552 SEVERE actions.c ] Could not load tick before test interval start 2011-01-01 00:00:00:000
java.lang.NullPointerException: Could not load tick before test interval start 2011-01-01 00:00:00:000
at com.dukascopy.dds2.greed.agent.strategy.tester.b.g.<init>(Unknown Source)
at com.dukascopy.dds2.greed.agent.strategy.tester.b.p.f(Unknown Source)
at com.dukascopy.dds2.greed.agent.strategy.tester.b.p.e(Unknown Source)
at com.dukascopy.dds2.greed.agent.strategy.tester.b.p.a(Unknown Source)
at com.dukascopy.dds2.greed.agent.strategy.tester.b.p.HH(Unknown Source)
at com.dukascopy.dds2.greed.agent.strategy.tester.w.run(Unknown Source)
at com.dukascopy.dds2.greed.agent.strategy.tester.b.a(Unknown Source)
at com.dukascopy.dds2.greed.actions.servicesources.StrategyTesterAction.CN(Unknown Source)
at com.dukascopy.dds2.greed.actions.servicesources.StrategyTesterAction.Ci(Unknown Source)
at com.dukascopy.dds2.greed.actions.c.run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:745)


 
 Post subject: Re: XAGUSD strategy Post rating: 0   New post Posted: Thu 22 May, 2014, 07:53 
User avatar

User rating:
Joined: Fri 31 Aug, 2007, 09:17
Posts: 6139
We are going to fix this as soon as possible.


 

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