|
Exception in Historical Tester |
[Frank]
|
Post subject: Exception in Historical Tester |
Post rating: 0
|
Posted: Wed 27 Apr, 2011, 22:58
|
|
User rating: 0
Joined: Thu 02 Sep, 2010, 05:01 Posts: 49
|
Hi Support, I pasted in OnStart method the following lines: Set subscribedInstruments = context.getSubscribedInstruments(); subscribedInstruments.add(Instrument.EURUSD); context.setSubscribedInstruments(subscribedInstruments); the strategy compiles; then I tried to backtesting it and I received in Historical Tester the following Exception: 21:44:51 Strategy tester: java.lang.UnsupportedOperationException @ FrankStrategy_2011_05.onStart(FrankStrategy_2011_05.java:58) the line 58 is subscribedInstruments.add(Instrument.EURUSD); Best regards, Frank
|
|
|
|
|
Contest Support
|
Post subject: Re: Exception in Historical Tester |
Post rating: 0
|
Posted: Thu 28 Apr, 2011, 08:10
|
|
User rating: 8
Joined: Wed 21 Apr, 2010, 10:42 Posts: 1167
|
In Historical Tester you simply have to click the currencies that you're subscribing to. Hardcoded version will not work.
|
|
|
|
|
[linnux]
|
|
Post subject: Re: Exception in Historical Tester |
Post rating: 0
|
Posted: Thu 28 Apr, 2011, 22:38
|
|
User rating: 0
Joined: Fri 03 Sep, 2010, 10:49 Posts: 11
|
Hello support,
I get the same Exception, and i enderstand your explanation, but i still have another question, Is it really needed to have the following code in the strategy for it works in the remote servers?
Set subscribedInstruments = context.getSubscribedInstruments(); subscribedInstruments.add(Instrument.EURUSD); context.setSubscribedInstruments(subscribedInstruments);
Because i don't have this peace of code in the past and my strategy runs good in the remote servers.
Thanks,
linnux
|
|
|
|
|
Contest Support
|
Post subject: Re: Exception in Historical Tester |
Post rating: 0
|
Posted: Fri 29 Apr, 2011, 09:20
|
|
User rating: 8
Joined: Wed 21 Apr, 2010, 10:42 Posts: 1167
|
Yes, for May you need to have this peace of code.
The Remote Server subscribes to the currencies from the platform. But in May you will you Dukascopy Forex Community web-site to run your strategy. You will upload the strategy right from the web-site and you need to indicate the subscribed currencies in the strategy code.
|
|
|
|
|
[linnux]
|
Post subject: Re: Exception in Historical Tester |
Post rating: 0
|
Posted: Fri 29 Apr, 2011, 15:35
|
|
User rating: 0
Joined: Fri 03 Sep, 2010, 10:49 Posts: 11
|
Hello again, I have this peace of code, a litle diferent from yours, but this work with the Historical Tester, could i use it instead the other, or this one don´t work in the remote servers? Set<Instrument> instSet = new HashSet<Instrument>(); instSet.add(Instrument.NZDUSD); context.setSubscribedInstruments(instSet);
Thanks,
linnux
|
|
|
|
|
Victor
|
Post subject: Re: Exception in Historical Tester |
Post rating: 0
|
Posted: Mon 02 May, 2011, 16:36
|
|
User rating: -
|
This is bit confusing dunno abut this and got stuck. The strategy is getting stopped by the remote server.
|
|
|
|
|
Contest Support
|
Post subject: Re: Exception in Historical Tester |
Post rating: 0
|
Posted: Tue 03 May, 2011, 09:44
|
|
User rating: 8
Joined: Wed 21 Apr, 2010, 10:42 Posts: 1167
|
linnux wrote: Hello again, I have this peace of code, a litle diferent from yours, but this work with the Historical Tester, could i use it instead the other, or this one don´t work in the remote servers? Set<Instrument> instSet = new HashSet<Instrument>(); instSet.add(Instrument.NZDUSD); context.setSubscribedInstruments(instSet);
Thanks,
linnux Yes, you can use this snippet. I think we might even recommend this snippet to everyone else because it does not give exception in the Historical Tester.
|
|
|
|
|
|
Pages: [
1
]
|
|
|
|
|