Dukascopy
 
 
Wiki JStore Search Login

IContext.unsubscribeFromFeed(listener) unsubsribes all listeners
 Post subject: IContext.unsubscribeFromFeed(listener) unsubsribes all listeners Post rating: 0   New post Posted: Fri 02 Nov, 2012, 15:44 

User rating: 1
Joined: Thu 23 Feb, 2012, 16:38
Posts: 44
Version: 2.7.5.1/2.21.4

Whenenvar you use the unsubscribeFromFeed(listener) method from IContext even the "Strategy-Feed-Listener" is unsubscribed. That means the onTick() Method in the running strategy isn´t called anymore. See the example Strategy attached to reproduce the error.

Attachment:
ExampleStrategy.java [2.79 KiB]
Downloaded 380 times


And please please please fix this asap. I´m waiting since one month for you to fix an reported bug in the standalone tester. Until now I helped myself with historic testing in the Desktop version, and since the update today I cannot test anything!!!


 
 Post subject: Re: IContext.unsubscribeFromFeed(listener) unsubsribes all listeners Post rating: 0   New post Posted: Mon 05 Nov, 2012, 11:55 
User avatar

User rating:
Joined: Fri 31 Aug, 2007, 09:17
Posts: 6139
Unfortunately we cannot reproduce it.
We have checked specified ExampleStrategy.java on both and "live" ticks and Historical Tester. When IFeedListener is subscribed, a strategy gets Ticks information in both and IFeedListener and Strategy's "onTick" method. When IFeedListener is unsubscribed, only "onTick" method gets Ticks data.

09:11:59 Tick: 1352106723977[2012-11-05 09:12:03.977+0000] / 1.2799 / 1.27982
09:11:59 Tick: 1352106723667[2012-11-05 09:12:03.667+0000] / 1.27987 / 1.27976
09:11:58 Tick: 1352106723337[2012-11-05 09:12:03.337+0000] / 1.27984 / 1.27973
09:11:57 Tick: 1352106721646[2012-11-05 09:12:01.646+0000] / 1.27977 / 1.27968
09:11:56 Tick: 1352106721466[2012-11-05 09:12:01.466+0000] / 1.27978 / 1.2797
09:11:56 Tick: 1352106720987[2012-11-05 09:12:00.987+0000] / 1.27977 / 1.27967
09:11:56 Tick: 1352106720873[2012-11-05 09:12:00.873+0000] / 1.27976 / 1.27969
09:11:56 Tick: 1352106720806[2012-11-05 09:12:00.806+0000] / 1.27973 / 1.27968
09:11:56 Tick: 1352106720738[2012-11-05 09:12:00.738+0000] / 1.27975 / 1.27961
09:11:55 Tick: 1352106720002[2012-11-05 09:12:00.002+0000] / 1.27975 / 1.27969
09:11:55 10 Secs
09:11:55 Unsubscribed
09:11:55 IFeedDescriptor: FeedDescriptor [dataType=TICKS, instrument=EUR/USD, period=Ticks, ], ITimedData: 1352106720002[2012-11-05 09:12:00.002+0000] / 1.27975 / 1.27969
09:11:55 Period: 1 Min, Instrument: EUR/USD Orders: 0
09:11:55 1 Min
09:11:55 Tick: 1352106719936[2012-11-05 09:11:59.936+0000] / 1.27975 / 1.27959
09:11:55 IFeedDescriptor: FeedDescriptor [dataType=TICKS, instrument=EUR/USD, period=Ticks, ], ITimedData: 1352106719936[2012-11-05 09:11:59.936+0000] / 1.27975 / 1.27959
09:11:51 Tick: 1352106715849[2012-11-05 09:11:55.849+0000] / 1.27957 / 1.2795
09:11:51 IFeedDescriptor: FeedDescriptor [dataType=TICKS, instrument=EUR/USD, period=Ticks, ], ITimedData: 1352106715849[2012-11-05 09:11:55.849+0000] / 1.27957 / 1.2795
09:11:50 Tick: 1352106715476[2012-11-05 09:11:55.476+0000] / 1.27959 / 1.27953
09:11:50 IFeedDescriptor: FeedDescriptor [dataType=TICKS, instrument=EUR/USD, period=Ticks, ], ITimedData: 1352106715476[2012-11-05 09:11:55.476+0000] / 1.27959 / 1.27953
09:11:46 Tick: 1352106710996[2012-11-05 09:11:50.996+0000] / 1.27959 / 1.27952
09:11:46 IFeedDescriptor: FeedDescriptor [dataType=TICKS, instrument=EUR/USD, period=Ticks, ], ITimedData: 1352106710996[2012-11-05 09:11:50.996+0000] / 1.27959 / 1.27952
09:11:46 10 Secs
09:11:43 Tick: 1352106708368[2012-11-05 09:11:48.368+0000] / 1.27959 / 1.27953
09:11:43 IFeedDescriptor: FeedDescriptor [dataType=TICKS, instrument=EUR/USD, period=Ticks, ], ITimedData: 1352106708368[2012-11-05 09:11:48.368+0000] / 1.27959 / 1.27953
09:11:43 Tick: 1352106708247[2012-11-05 09:11:48.247+0000] / 1.2796 / 1.27955
09:11:43 IFeedDescriptor: FeedDescriptor [dataType=TICKS, instrument=EUR/USD, period=Ticks, ], ITimedData: 1352106708247[2012-11-05 09:11:48.247+0000] / 1.2796 / 1.27955
09:11:43 Tick: 1352106707587[2012-11-05 09:11:47.587+0000] / 1.2796 / 1.27956
09:11:43 IFeedDescriptor: FeedDescriptor [dataType=TICKS, instrument=EUR/USD, period=Ticks, ], ITimedData: 1352106707587[2012-11-05 09:11:47.587+0000] / 1.2796 / 1.27956
09:11:42 Tick: 1352106707446[2012-11-05 09:11:47.446+0000] / 1.27961 / 1.27956
09:11:42 IFeedDescriptor: FeedDescriptor [dataType=TICKS, instrument=EUR/USD, period=Ticks, ], ITimedData: 1352106707446[2012-11-05 09:11:47.446+0000] / 1.27961 / 1.27956
09:11:42 Tick: 1352106706926[2012-11-05 09:11:46.926+0000] / 1.27962 / 1.27956
09:11:42 IFeedDescriptor: FeedDescriptor [dataType=TICKS, instrument=EUR/USD, period=Ticks, ], ITimedData: 1352106706926[2012-11-05 09:11:46.926+0000] / 1.27962 / 1.27956
09:11:42 Tick: 1352106706674[2012-11-05 09:11:46.674+0000] / 1.27964 / 1.27959
Historical Tester Ticks:
09:15:46 Tick: 1352073670167[2012-11-05 00:01:10.167+0000] / 1.28258 / 1.2825
09:15:46 Tick: 1352073669864[2012-11-05 00:01:09.864+0000] / 1.28254 / 1.28245
09:15:46 Tick: 1352073668615[2012-11-05 00:01:08.615+0000] / 1.28253 / 1.28243
09:15:46 Tick: 1352073668032[2012-11-05 00:01:08.032+0000] / 1.28253 / 1.28245
09:15:46 Tick: 1352073667964[2012-11-05 00:01:07.964+0000] / 1.28253 / 1.28249
09:15:46 Tick: 1352073667515[2012-11-05 00:01:07.515+0000] / 1.28254 / 1.28249
09:15:46 Tick: 1352073666715[2012-11-05 00:01:06.715+0000] / 1.28258 / 1.2825
09:15:46 Tick: 1352073666155[2012-11-05 00:01:06.155+0000] / 1.28257 / 1.28249
09:15:46 Tick: 1352073664105[2012-11-05 00:01:04.105+0000] / 1.28257 / 1.28249
09:15:46 Tick: 1352073663594[2012-11-05 00:01:03.594+0000] / 1.28256 / 1.28247
09:15:46 Tick: 1352073663057[2012-11-05 00:01:03.057+0000] / 1.28255 / 1.28247
09:15:46 Tick: 1352073662934[2012-11-05 00:01:02.934+0000] / 1.28252 / 1.28245
09:15:46 Tick: 1352073662695[2012-11-05 00:01:02.695+0000] / 1.28252 / 1.28244
09:15:46 Tick: 1352073661844[2012-11-05 00:01:01.844+0000] / 1.28252 / 1.28243
09:15:46 Tick: 1352073660689[2012-11-05 00:01:00.689+0000] / 1.28254 / 1.28243
09:15:46 Tick: 1352073660184[2012-11-05 00:01:00.184+0000] / 1.28252 / 1.28242
09:15:46 Unsubscribed
09:15:46 Period: 1 Min, Instrument: EUR/USD Orders: 0
09:15:46 IFeedDescriptor: FeedDescriptor [dataType=TICKS, instrument=EUR/USD, period=Ticks, ], ITimedData: 1352073659824[2012-11-05 00:00:59.824+0000] / 1.2825 / 1.28242
09:15:46 Tick: 1352073659824[2012-11-05 00:00:59.824+0000] / 1.2825 / 1.28242
09:15:46 IFeedDescriptor: FeedDescriptor [dataType=TICKS, instrument=EUR/USD, period=Ticks, ], ITimedData: 1352073659764[2012-11-05 00:00:59.764+0000] / 1.28249 / 1.28242
09:15:46 Tick: 1352073659764[2012-11-05 00:00:59.764+0000] / 1.28249 / 1.28242
09:15:46 IFeedDescriptor: FeedDescriptor [dataType=TICKS, instrument=EUR/USD, period=Ticks, ], ITimedData: 1352073659404[2012-11-05 00:00:59.404+0000] / 1.28249 / 1.2824
09:15:46 Tick: 1352073659404[2012-11-05 00:00:59.404+0000] / 1.28249 / 1.2824
09:15:46 IFeedDescriptor: FeedDescriptor [dataType=TICKS, instrument=EUR/USD, period=Ticks, ], ITimedData: 1352073659224[2012-11-05 00:00:59.224+0000] / 1.28249 / 1.2824
09:15:46 Tick: 1352073659224[2012-11-05 00:00:59.224+0000] / 1.28249 / 1.2824
09:15:46 IFeedDescriptor: FeedDescriptor [dataType=TICKS, instrument=EUR/USD, period=Ticks, ], ITimedData: 1352073659104[2012-11-05 00:00:59.104+0000] / 1.28249 / 1.28241
09:15:46 Tick: 1352073659104[2012-11-05 00:00:59.104+0000] / 1.28249 / 1.28241
09:15:46 IFeedDescriptor: FeedDescriptor [dataType=TICKS, instrument=EUR/USD, period=Ticks, ], ITimedData: 1352073658545[2012-11-05 00:00:58.545+0000] / 1.28245 / 1.2824
09:15:46 Tick: 1352073658545[2012-11-05 00:00:58.545+0000] / 1.28245 / 1.2824
09:15:46 IFeedDescriptor: FeedDescriptor [dataType=TICKS, instrument=EUR/USD, period=Ticks, ], ITimedData: 1352073658420[2012-11-05 00:00:58.420+0000] / 1.28245 / 1.28237
09:15:46 Tick: 1352073658420[2012-11-05 00:00:58.420+0000] / 1.28245 / 1.28237
09:15:46 IFeedDescriptor: FeedDescriptor [dataType=TICKS, instrument=EUR/USD, period=Ticks, ], ITimedData: 1352073658294[2012-11-05 00:00:58.294+0000] / 1.28243 / 1.28236
09:15:46 Tick: 1352073658294[2012-11-05 00:00:58.294+0000] / 1.28243 / 1.28236
09:15:46 IFeedDescriptor: FeedDescriptor [dataType=TICKS, instrument=EUR/USD, period=Ticks, ], ITimedData: 1352073658234[2012-11-05 00:00:58.234+0000] / 1.28243 / 1.28236
09:15:46 Tick: 1352073658234[2012-11-05 00:00:58.234+0000] / 1.28243 / 1.28236

We have attached an extended version of ExampleStrategy.


Attachments:
ExampleStrategy.java [3.28 KiB]
Downloaded 364 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.unsubscribeFromFeed(listener) unsubsribes all listeners Post rating: 0   New post Posted: Mon 05 Nov, 2012, 13:25 

User rating: 1
Joined: Thu 23 Feb, 2012, 16:38
Posts: 44
Every time I use the unsubscribeFromFeed method the last Tick I receive is at 1:23 at the first day of the test period. Please test the example strategy for one week and take a look at the last tick time in the report at the end:

It is:
Last tick time 2011-04-21 01:23:22

But it should be (when i comment out this.context.unsubscribeFromFeed(feedListener), I get this result)
Last tick time 2012-11-04 23:59:52

So the strategy stops receiving ticks not in the moment the feed listener unsubscribes, but some time later.


 
 Post subject: Re: IContext.unsubscribeFromFeed(listener) unsubsribes all listeners Post rating: 0   New post Posted: Tue 06 Nov, 2012, 09:10 

User rating: 1
Joined: Thu 23 Feb, 2012, 16:38
Posts: 44
By the way this bug is not fixed, so please remove it from the fixed bugs section.


 
 Post subject: Re: IContext.unsubscribeFromFeed(listener) unsubsribes all listeners Post rating: 0   New post Posted: Wed 07 Nov, 2012, 17:20 
User avatar

User rating:
Joined: Fri 31 Aug, 2007, 09:17
Posts: 6139
API 2.7.6


 
 Post subject: Re: IContext.unsubscribeFromFeed(listener) unsubsribes all listeners Post rating: 0   New post Posted: Thu 08 Nov, 2012, 14:49 

User rating: 1
Joined: Thu 23 Feb, 2012, 16:38
Posts: 44
And when will API 2.7.6 be released?


 
 Post subject: Re: IContext.unsubscribeFromFeed(listener) unsubsribes all listeners Post rating: 0   New post Posted: Thu 08 Nov, 2012, 15:06 
User avatar

User rating:
Joined: Fri 31 Aug, 2007, 09:17
Posts: 6139
Next week


 

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