Dukascopy
 
 
Wiki JStore Search Login

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

    Try to find an answer in Wiki before asking a question.
    Submit programming questions in this forum only.
    Off topics are strictly forbidden.

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

During the weekend, why does onBar get called endlessly?
 Post subject: During the weekend, why does onBar get called endlessly? Post rating: 0   New post Posted: Sat 23 Sep, 2017, 09:55 

User rating: 0
Joined: Mon 29 May, 2017, 17:19
Posts: 21
Location: Germany,
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!


 
 Post subject: Re: During the weekend, why does onBar get called endlessly? Post rating: 1   New post Posted: Mon 02 Oct, 2017, 08:06 
User avatar

User rating:
Joined: Fri 31 Aug, 2007, 09:17
Posts: 6139
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


 
 Post subject: Re: During the weekend, why does onBar get called endlessly? Post rating: 0   New post Posted: Mon 02 Oct, 2017, 08:14 

User rating: 0
Joined: Mon 29 May, 2017, 17:19
Posts: 21
Location: Germany,
I see. Thanks as always for your feedback. I really appreciate it!


 

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