Dukascopy
 
 
Wiki JStore Search Login

JFOREX-2253 : JFException: Instrument [...] not opened in v2.5.1
 Post subject: JFOREX-2253 : JFException: Instrument [...] not opened in v2.5.1 Post rating: 0   New post Posted: Thu 23 Sep, 2010, 03:31 

User rating: 1
Joined: Fri 26 Mar, 2010, 19:19
Posts: 116
Location: Canada
I just upgraded my JForex platform to 2.5.1. When I start my contest strategy I am getting the following JFException. I am connected to the server.

02:28:20 Strategy "quantisan2" is stopped at 2010-09-23 02:28:20.749 GMT on the local computer
02:28:20 ---Stopped---
02:28:20 Stopping "quantisan2" strategy at 2010-09-23 02:28:20.748 GMT on the local computer
02:28:20 com.dukascopy.api.JFException: Instrument [EUR/USD] not opened @ jforex.quantisan2.onStart(quantisan2.java:392)
02:28:20 --- Started class jforex.quantisan2 v.2.18 ---[EUR/USD] ---
02:28:20 Strategy "quantisan2" is started at 2010-09-23 02:28:20.746 GMT on the local computer
02:28:20 Starting "quantisan2" strategy at 2010-09-23 02:28:20.739 GMT on the local computer


 
 Post subject: Re: JFException: Instrument [...] not opened in v2.5.1 Post rating: 0   New post Posted: Thu 23 Sep, 2010, 04:33 

User rating: 0
Joined: Fri 07 May, 2010, 02:59
Posts: 61
I'm sorry if this seems like a 'no duh, I checked that' answer ... but I'll throw it out anyway just in case.

Are you sure you registered to get EUR/USD?

-Brian


 
 Post subject: Re: JFException: Instrument [...] not opened in v2.5.1 Post rating: 0   New post Posted: Thu 23 Sep, 2010, 13:15 

User rating: 1
Joined: Fri 26 Mar, 2010, 19:19
Posts: 116
Location: Canada
yes, it's listed as one of my instruments in the workspace

the strategy has been working before the 2.5.1 upgrade. I've been running it for September.


 
 Post subject: Re: JFOREX-2253 : JFException: Instrument [...] not opened i Post rating: 0   New post Posted: Sun 26 Sep, 2010, 22:20 

User rating: 1
Joined: Fri 26 Mar, 2010, 19:19
Posts: 116
Location: Canada
I am still having the same problem in 2.5.2.

The problem seems to be that my strategy is calling for IHistory in onStart(). You can try it with my August contest strategy as it's receiving the same JFException.


 
 Post subject: Re: JFOREX-2253 : JFException: Instrument [...] not opened i Post rating: 0   New post Posted: Mon 27 Sep, 2010, 17:31 
User avatar

User rating: 5
Joined: Fri 02 Sep, 2011, 10:08
Posts: 157
Location: FranceFrance
I have the same problem to by calling in onStart()
ITick lastTick = history.getLastTick(currentInstrument);


 
 Post subject: Re: JFOREX-2253 : JFException: Instrument [...] not opened i Post rating: 0   New post Posted: Tue 28 Sep, 2010, 14:33 
User avatar

User rating:
Joined: Fri 31 Aug, 2007, 09:17
Posts: 6139
Thanks, this is registered, will be fixed ASAP.


 
 Post subject: Re: JFOREX-2253 : JFException: Instrument [...] not opened i Post rating: 0   New post Posted: Fri 01 Oct, 2010, 18:58 

User rating: 0
Joined: Fri 01 Oct, 2010, 18:37
Posts: 8
Same problem here. The strategy works now in JForex Client, but it cannot be started via API (using the provided singlejartest.Main class). Please update the API ASAP as well.

Another suggestion: on page https://www.dukascopy.com/swiss/english/forex/jforex/library/ you should display the version number of the downloadable JForex Library. There's only a big "Download" link now, so we have to download the JForexClientLibrary.zip file and check it's contest to see the version number ... not too straightforward.


 
 Post subject: Re: JFOREX-2253 : JFException: Instrument [...] not opened i Post rating: 0   New post Posted: Sun 03 Oct, 2010, 23:17 

User rating: 0
Joined: Wed 18 May, 2011, 11:25
Posts: 60
Location: DE
add this code in the onStart() method and add the instruments that you want to use:

       Set<Instrument> set = context.getSubscribedInstruments();       
       set.add(Instrument.EURUSD);
       context.setSubscribedInstruments(set);


 
 Post subject: Re: JFOREX-2253 : JFException: Instrument [...] not opened i Post rating: 0   New post Posted: Mon 18 Oct, 2010, 23:21 
User avatar

User rating: 0
Joined: Thu 16 Jun, 2011, 21:37
Posts: 98
Location: SwitzerlandSwitzerland
thanks for the quick fix, been running into this error as well

edit://doesn't seem like the quick fix is working...I'm getting:
null: java.lang.UnsupportedOperationException
at java.util.Collections$UnmodifiableCollection.add(Collections.java:1018)


 
 Post subject: Re: JFOREX-2253 : JFException: Instrument [...] not opened i Post rating: 0   New post Posted: Fri 22 Oct, 2010, 12:38 
User avatar

User rating:
Joined: Fri 31 Aug, 2007, 09:17
Posts: 6139
Try this:
Quote:
Set<Instrument> set = new HashSet<Instrument>(context.getSubscribedInstruments());
set.add(Instrument.EURUSD);
context.setSubscribedInstruments(set);


 

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