Dukascopy
 
 
Wiki JStore Search Login

IContext.setSubscribedInstruments(ins) and IContext.getSubscribedInstruments() do not work.
 Post subject: IContext.setSubscribedInstruments(ins) and IContext.getSubscribedInstruments() do not work. Post rating: 0   New post Posted: Fri 19 Oct, 2012, 16:06 
User avatar

User rating: 7
Joined: Fri 13 Jan, 2012, 20:49
Posts: 94
Location: Poland, Warsaw
Hello Dear Support,

Methods IContext.setSubscribedInstruments(ins) and IContext.getSubscribedInstruments() stopped working.

The first one does not subscribe to defined set of instruments. The latter returns empty Set even if there were instruments subscribed through IClient.setSubscribedInstruments(ins). As a result, among other problems, JFUtils does not work (for example convertPipToCurrency()).

I see no body reported the issue so maybe it is something specific to my config. I tested this on 3 pc - the result is the same: Java 1.6, JForex API 2.7.4

I am attaching the full code.

Below a snipped and result:
        if (!client.isConnected()) {System.exit(1);}
       
        Set<Instrument> instrumentsClient = new HashSet();
        instrumentsClient.add(Instrument.EURSEK);
        client.setSubscribedInstruments(instrumentsClient);
        Thread.sleep(5000);
       
        System.out.println("Subscribed instruments: " + client.getSubscribedInstruments());
       
        client.startStrategy(new IStrategy(){
           
            IContext context;
           
            public void onStart(IContext context) throws JFException {
                this.context = context;     
                Set<Instrument> instrumentsContext = new HashSet();
                instrumentsContext.add(Instrument.EURJPY);
                instrumentsContext.add(Instrument.GBPUSD);
                context.setSubscribedInstruments(instrumentsContext);
            }

            public void onTick(Instrument instrument, ITick tick) throws JFException {
                System.out.println(
                        instrument.name()
                        + ", subscribed instruments: "
                        + context.getSubscribedInstruments() + " "
                        + context.getSubscribedInstruments().size());         
            }


The result:
Subscribed instruments [IClinet]: [USD/SEK, AUD/USD, EUR/SEK]
USDSEK, subscribed instruments [IContext]: [] 0
AUDUSD, subscribed instruments [IContext]: [] 0
USDSEK, subscribed instruments [IContext]: [] 0
AUDUSD, subscribed instruments [IContext]: [] 0
AUDUSD, subscribed instruments [IContext]: [] 0
AUDUSD, subscribed instruments [IContext]: [] 0
AUDUSD, subscribed instruments [IContext]: [] 0


best regards,
Kurak


Attachments:
InstrumentSubscriptionTest.java [3.04 KiB]
Downloaded 420 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: IContext.setSubscribedInstruments(ins) and IContext.getSubscribedInstruments() do not work. Post rating: 0   New post Posted: Tue 23 Oct, 2012, 10:53 
User avatar

User rating: 7
Joined: Fri 13 Jan, 2012, 20:49
Posts: 94
Location: Poland, Warsaw
Hi Dear Support,

I don't know how about others but for me both mentioned methods are the ones most important and critical for my implementation. Acutally I cannot work without them.

Are you planning to deliver the fix anytime soon?

best regards,
Kurak


 
 Post subject: Re: IContext.setSubscribedInstruments(ins) and IContext.getSubscribedInstruments() do not work. Post rating: 0   New post Posted: Tue 23 Oct, 2012, 11:22 
User avatar

User rating:
Joined: Fri 31 Aug, 2007, 09:17
Posts: 6139
Yes, we are.


 
 Post subject: Re: IContext.setSubscribedInstruments(ins) and IContext.getSubscribedInstruments() do not work. Post rating: 0   New post Posted: Tue 30 Oct, 2012, 09:21 
User avatar

User rating: 7
Joined: Fri 13 Jan, 2012, 20:49
Posts: 94
Location: Poland, Warsaw
Hi,


Can you please provide information when are you going to fix this issue. Please be aware it is one the most critical functionality of your API for my system.

best regards,
Kurak


 
 Post subject: Re: IContext.setSubscribedInstruments(ins) and IContext.getSubscribedInstruments() do not work. Post rating: 0   New post Posted: Tue 30 Oct, 2012, 14:27 
User avatar

User rating:
Joined: Fri 31 Aug, 2007, 09:17
Posts: 6139
The reason is that you have not set the SystemListner to the IClient.
We have made a bypass fix for this situation.


 
 Post subject: Re: IContext.setSubscribedInstruments(ins) and IContext.getSubscribedInstruments() do not work. Post rating: 0   New post Posted: Wed 31 Oct, 2012, 08:53 
User avatar

User rating: 7
Joined: Fri 13 Jan, 2012, 20:49
Posts: 94
Location: Poland, Warsaw
Thank you!

Adding sys listener solved the issue.

best regards,
Kurak


 

Jump to:  

  © 1998-2024 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