Dukascopy Support Board
http://www.dukascopy.com/swiss/english/forex/jforex/forum/

During the weekend, why does onBar get called endlessly?
http://www.dukascopy.com/swiss/english/forex/jforex/forum/viewtopic.php?f=65&t=55519
Page 1 of 1

Author:  Nebilar [ Sat 23 Sep, 2017, 09:55 ]
Post subject:  During the weekend, why does onBar get called endlessly?

I just observed the following behavior:

On weekends, it seems that the onBar method gets triggered for every bar that happened since the first weekend flat bar (at friday 20:00 I suppose).
Why is that? I thought that onBar (and onTick, didn't check that one) should only be triggered for the last finished bar, but not for the history?

I suppose, I have to filter weekends in my code by using that code? : https://www.dukascopy.com/wiki/en/devel ... rket-hours

thanks!

Author:  API Support [ Mon 02 Oct, 2017, 08:06 ]
Post subject:  Re: During the weekend, why does onBar get called endlessly?

This is correct behavior. Strategy will receive all bars even during the weekend.
Flat bars on weekend will have equal open, close, high and low prices and 0 volume.
And yes weekend can be detected using this:
https://www.dukascopy.com/wiki/en/devel ... rket-hours

Author:  Nebilar [ Mon 02 Oct, 2017, 08:14 ]
Post subject:  Re: During the weekend, why does onBar get called endlessly?

I see. Thanks as always for your feedback. I really appreciate it!

  Page 1 of 1