Dukascopy
 
 
Wiki JStore Search Login

JFOREX-2187 History / askBars volume NOT ZERO over weekends
 Post subject: JFOREX-2187 History / askBars volume NOT ZERO over weekends Post rating: 0   New post Posted: Thu 26 Aug, 2010, 09:17 

User rating: 0
Joined: Mon 09 Aug, 2010, 10:23
Posts: 5
Hi,

When iterating over a List of WEEKEND filtered bidBar/s as follows:

java.util.List<IBar> chunk = history.getBars(instrument, period, OfferSide.BID, Filter.WEEKENDS, 0, chunkStartBarTime, chunkBarsCount);
for (IBar bidBar : chunk) {//--------------- Write chunk data to a csv file
   bidBarOTCal.setTimeInMillis(bidBar.getTime());
   bidBarCTCal.setTimeInMillis(bidBar.getTime()+period.getInterval());
   IBar askBar = history.getBars(instrument, period, OfferSide.ASK, bidBar.getTime(), bidBar.getTime()).askBars.get(0);
   
    if (askBar != null){
        askBarOTCal.setTimeInMillis(askBar.getTime());
        if (bidBar.getTime() != askBar.getTime()){
            console.getOut().println("WRONG askBAR");
        }
        try {
            fw.append(timeFormatter.format(bidBarOTCal.getTimeInMillis()) + "," +
                      instrument.toString().replaceFirst("/","") + "," +
                      period.getInterval()/60000L + "," +
                      bidBar.getOpen() + "," +
                      bidBar.getHigh() + "," +
                      bidBar.getLow() + "," +
                      bidBar.getClose() + "," +
                      bidBar.getVolume() + "," +
                      askBar.getVolume() + "," +
                      0 + ","
                      0 + ","
                      0 + ","
                      timeFormatter.format(System.currentTimeMillis())+"\n");
            totalBarsInPeriod++;
        } catch (Exception e) {
            e.printStackTrace(console.getErr());
        }
    }
}


I get non filtered WEEKEND bars as follows (two sample lines):

2010.08.22 21:00:00,GBPUSD,5,1.55335,1.55335,1.55335,1.55335,0.0,25.9,0,0,0,2010.08.26 07:46:26
2010.08.22 21:05:00,GBPUSD,5,1.55335,1.55335,1.55335,1.55335,0.0,10.0,0,0,0,2010.08.26 07:46:26

Note the red bidVolume and askVolume numbers (respectively). As you can see the askVolume is not zero - which might be why these bars are not filtered as they should. It goes on like that for the whole weekend where the first "real" non zero bar is on Sunday midnight GMT - here's the last two lines:

2010.08.22 23:55:00,GBPUSD,5,1.55335,1.55335,1.55335,1.55335,0.0,652.5,0,0,0,2010.08.26 07:46:26
2010.08.23 00:00:00,GBPUSD,5,1.55515,1.5557,1.55485,1.55555,686.0,1012.0,0,0,0,2010.08.26 07:46:26

Is it something in the way I handle it or is it a bug?

Thanks.


 
 Post subject: Re: JFOREX-2187 History / askBars volume NOT ZERO over weeke Post rating: 0   New post Posted: Mon 30 Aug, 2010, 10:15 
User avatar

User rating:
Joined: Fri 31 Aug, 2007, 09:17
Posts: 6139
Weekends filter filters candles from 21:00 Friday to 21:00 sunday. It doesn't look at prices or volumes


 
 Post subject: Re: JFOREX-2187 History / askBars volume NOT ZERO over weeke Post rating: 0   New post Posted: Tue 31 Aug, 2010, 10:09 

User rating: 0
Joined: Mon 09 Aug, 2010, 10:23
Posts: 5
Support wrote:
Weekends filter filters candles from 21:00 Friday to 21:00 sunday. It doesn't look at prices or volumes


OK... So this is a bug?


 
 Post subject: Re: JFOREX-2187 History / askBars volume NOT ZERO over weeke Post rating: 0   New post Posted: Wed 22 Sep, 2010, 12:05 
User avatar

User rating:
Joined: Fri 31 Aug, 2007, 09:17
Posts: 6139
It is not a bug


 

Jump to:  

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