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.

Open values of an open 10sec bar sometimes change after creation?
 Post subject: Open values of an open 10sec bar sometimes change after creation? Post rating: 0   New post Posted: Mon 07 May, 2018, 20:28 

User rating: 0
Joined: Mon 29 May, 2017, 17:19
Posts: 21
Location: Germany,
I´ve noticed some odd behavior:
After a new 10sec Bar has formed, sometimes it seems like the open later on changes.
I noticed it this way:
when I get a new time from any crossrate with the 10sec timeframe, I request a new Bar using getBar() with a shift of 0 for all crossrates.
I make sure that the returned bar has the new time as well (otherwise I wait a bit and request again, until I got a new bar that has the same epoch as the newest epoch that I received.

Now I was thinking that once I get a new Bar, open NEVER changes. But this does not seem to be the case. Instead, I observed that for some crossrates of the same time, open changes after a while. IF a change occurs, it only occurs ONCE per crossrate, and only for a few crossrates, not all of them.

So I suspect:
When it is time for a new Bar, it gets auto generated, with probably the last bars close as OHLC values. Volume is 0, because there was no transaction yet. Once the first transaction is recorded, this is replaced by the now known price, again, for all OHLC values, but now with the first known volume. The reason for that is probably to provide a fluid user experience, showing some data instead of waiting for the first transaction to show up.

This basically means:
No transactions: no volume, OHLC = last candles close.
First transaction: OHLC is the price of that transaction, + its volume.

Is this correct?


 
 Post subject: Re: Open values of an open 10sec bar sometimes change after creation? Post rating: 0   New post Posted: Fri 11 May, 2018, 11:38 
User avatar

User rating:
Joined: Fri 31 Aug, 2007, 09:17
Posts: 6139
Nebilar wrote:
This basically means:
No transactions: no volume, OHLC = last candles close.
First transaction: OHLC is the price of that transaction, + its volume.

Is this correct?

That's right.
After formation new bar receives previousBar.getClose() price as it OHLC values. This will be it parameters until appears first tick, which will overwrite bar OHLC parameters.
You can check by comparing volumes(bar.getVolume() ), bar with previousBar.getClose() will have zero volume.


 
 Post subject: Re: Open values of an open 10sec bar sometimes change after creation? Post rating: 0   New post Posted: Fri 11 May, 2018, 19:05 

User rating: 0
Joined: Mon 29 May, 2017, 17:19
Posts: 21
Location: Germany,
Thank you for verifying!


 

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