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.

duplicate bars
 Post subject: duplicate bars Post rating: 0   New post Posted: Mon 24 Jul, 2017, 03:28 
User avatar

User rating: 0
Joined: Mon 24 Jul, 2017, 03:18
Posts: 1
Location: China,
I subscribed 10 seconds bar for eurusd. I received bars for the same period several times but with different open/high/low/close values. Not sure which one is correct. It happened pretty frequently. The following are some examples. All the timestamps are epoch and GMT

1500846780000 2017-07-23T21:53 1.16661 1.16661 1.16661 1.16661
1500846780000 2017-07-23T21:53 1.16661 1.16703 1.16661 1.16676


1500846840000 2017-07-23T21:54 1.16674 1.16674 1.16674 1.16674
1500846840000 2017-07-23T21:54 1.16674 1.16675 1.16674 1.16675

1500846600000 2017-07-23T21:50 1.16664 1.16664 1.16664 1.16664
1500846600000 2017-07-23T21:50 1.16664 1.16703 1.1666 1.16675
1500846600000 2017-07-23T21:50 1.16664 1.16703 1.16655 1.16664
1500846600000 2017-07-23T21:50 1.16664 1.16664 1.16661 1.16662


 
 Post subject: Re: duplicate bars Post rating: 0   New post Posted: Mon 24 Jul, 2017, 08:03 
User avatar

User rating:
Joined: Fri 31 Aug, 2007, 09:17
Posts: 6139
The problem might be that the onBar method receives candles from several instruments.
To receive candles from single instrument please use this code:
    public void onBar(Instrument instrument, Period period, IBar askBar, IBar bidBar) throws JFException {
        if(!period.equals(Period.TEN_SECS) || !Instrument.EURCHF.equals(instrument) ) {
            return;
        }
    }


 

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