Dukascopy
 
 
Wiki JStore Search Login

Attention! Read the forum rules carefully before posting a topic.

    Submit JForex API bug reports in this forum only.
    Submit Converter issues in Converter Issues.
    Off topics are strictly forbidden.

Any topics which do not satisfy these rules will be deleted.

TickFeedListener doesn´t received all ticks
 Post subject: TickFeedListener doesn´t received all ticks Post rating: 0   New post Posted: Wed 13 May, 2015, 17:38 
User avatar

User rating: 2
Joined: Wed 03 Sep, 2014, 09:11
Posts: 32
Location: GermanyGermany
Dear support,

it seems there is a bug in TickFeedListener and maybe in all other FeedListeners.

Please consider the following simple Strategie to reproduce the problem. The listeneres received a different number of ticks, especially the first listener "Listener 1" reveived ticks only sometimes!
package jforex;

import com.dukascopy.api.*;
import com.dukascopy.api.feed.ITickFeedListener;

import java.util.HashSet;
import java.util.Set;

/**
 * Created by RN on 13.05.2015.
 * Copyright 2015 Forex Money Maker
 */
public class ListenerTest implements IStrategy {
    private IEngine engine;
    private IConsole console;
    private IHistory history;
    private IContext context;
    private IIndicators indicators;
    private IUserInterface userInterface;
   
    @Override
    public void onStart(IContext context) throws JFException {
        this.context = context;
        this.engine = context.getEngine();
        this.console = context.getConsole();
        this.history = context.getHistory();
        this.context = context;
        this.indicators = context.getIndicators();
        this.userInterface = context.getUserInterface();

        Set<Instrument> instruments = new HashSet<>();
        instruments.add(Instrument.GBPJPY);
        this.context.setSubscribedInstruments(instruments,true);
       
        TickListenerTest listener1 = new TickListenerTest("Listener 1",Instrument.GBPJPY,this.context);
        TickListenerTest listener2 = new TickListenerTest("Listener 2",Instrument.GBPJPY,this.context);
        TickListenerTest listener3 = new TickListenerTest("Listener 3",Instrument.GBPJPY,this.context);
        TickListenerTest listener4 = new TickListenerTest("Listener 4",Instrument.GBPJPY,this.context);
        listener1.registerListener();
        listener2.registerListener();
        listener3.registerListener();
        listener4.registerListener();

    }

    @Override
    public void onTick(Instrument instrument, ITick tick) throws JFException {

    }

    @Override
    public void onBar(Instrument instrument, Period period, IBar askBar, IBar bidBar) throws JFException {

    }

    @Override
    public void onMessage(IMessage message) throws JFException {

    }

    @Override
    public void onAccount(IAccount account) throws JFException {

    }
   
    @Override
    public void onStop() throws JFException {

    }
    class TickListenerTest implements ITickFeedListener {
        private final String name;
        private final Instrument instrument;
        private final IContext context;
        private int counter;

        public TickListenerTest(String name, Instrument instrument, IContext context) {
            if (name==null || instrument == null || context == null) {
                throw new IllegalArgumentException("parameters must not be null!");
            }
            this.name = name;
            this.instrument = instrument;
            this.context = context;
        }

        public void registerListener() {
            context.subscribeToTicksFeed(this.instrument, this);
        }

        @Override
        public void onTick(Instrument instrument, ITick tick) {

            context.getConsole().getOut().println("Tick received in: " + this.name + "      total received ticks=" + ++counter);
            //context.getConsole().getOut().println("Tick received in: " + this.name + " tick=" + tick);
        }
    }

}



Please investigate and let us know the result.

Thank you and best regards,

Jack

checked on demo account SDK and JForex
JClient 2.44.7
JForex-API 2.12.9


 
 Post subject: Re: TickFeedListener don´t received all ticks Post rating: 0   New post Posted: Wed 13 May, 2015, 17:59 
User avatar

User rating: 2
Joined: Wed 03 Sep, 2014, 09:11
Posts: 32
Location: GermanyGermany
here is a result after 30 minutes from today:


    16:56:11 Tick received in: Listener 4 total received ticks=1875
    16:56:11 Tick received in: Listener 3 total received ticks=1759
    16:56:11 Tick received in: Listener 1 total received ticks=33
    16:56:09 Tick received in: Listener 4 total received ticks=1874
    16:56:09 Tick received in: Listener 3 total received ticks=1758
    16:56:09 Tick received in: Listener 2 total received ticks=998
    16:56:07 Tick received in: Listener 4 total received ticks=1873
    16:56:07 Tick received in: Listener 3 total received ticks=1757





 
 Post subject: Re: TickFeedListener doesn´t received all ticks Post rating: 0   New post Posted: Fri 15 May, 2015, 09:11 
User avatar

User rating:
Joined: Fri 31 Aug, 2007, 09:17
Posts: 6139
We are investigating it. The problem will be solved as soon as possible.


 
 Post subject: Re: TickFeedListener doesn´t received all ticks Post rating: 0   New post Posted: Fri 15 May, 2015, 09:34 
User avatar

User rating: 2
Joined: Wed 03 Sep, 2014, 09:11
Posts: 32
Location: GermanyGermany
Thank you for your quick reply!


 
 Post subject: Re: TickFeedListener doesn´t received all ticks Post rating: 0   New post Posted: Wed 10 Jun, 2015, 11:40 
User avatar

User rating: 2
Joined: Wed 03 Sep, 2014, 09:11
Posts: 32
Location: GermanyGermany
any news???


 
 Post subject: Re: TickFeedListener doesn´t received all ticks Post rating: 0   New post Posted: Tue 07 Jul, 2015, 09:24 
User avatar

User rating: 2
Joined: Wed 03 Sep, 2014, 09:11
Posts: 32
Location: GermanyGermany
Hello support,

is it possible to get an answer?

THX


 
 Post subject: Re: TickFeedListener doesn´t received all ticks Post rating: 0   New post Posted: Mon 13 Jul, 2015, 07:32 
User avatar

User rating:
Joined: Fri 31 Aug, 2007, 09:17
Posts: 6139
This is fixed and will be available in next SDK version.


 

Jump to:  

cron
  © 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