Gamestudio Links
Zorro Links
Newest Posts
Blobsculptor tools and objects download here
by NeoDumont. 03/28/24 03:01
Issue with Multi-Core WFO Training
by aliswee. 03/24/24 20:20
Why Zorro supports up to 72 cores?
by Edgar_Herrera. 03/23/24 21:41
Zorro Trader GPT
by TipmyPip. 03/06/24 09:27
VSCode instead of SED
by 3run. 03/01/24 19:06
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
2 registered members (Quad, aliswee), 835 guests, and 5 spiders.
Key: Admin, Global Mod, Mod
Newest Members
sakolin, rajesh7827, juergen_wue, NITRO_FOREVER, jack0roses
19043 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Bug in first bar of week construction #471582
03/10/18 14:40
03/10/18 14:40
Joined: Jul 2017
Posts: 783
Z
Zheka Offline OP
User
Zheka  Offline OP
User
Z

Joined: Jul 2017
Posts: 783
JCL,

with Weekend=1, the very first bar of the week is constructed incorrectly (1 M1 shift). The next bars are ok.

v 1.79.7

Attached Files Zorro_1stbar_bug_weekend1.PNG
Re: Bug in first bar of week construction [Re: Zheka] #471635
03/12/18 09:17
03/12/18 09:17
Joined: Jul 2000
Posts: 27,977
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,977
Frankfurt
Thanks, we'll look into this. It is probably a rounding error again.

Re: Bug in first bar of week construction [Re: jcl] #471643
03/12/18 14:11
03/12/18 14:11
Joined: Jul 2017
Posts: 783
Z
Zheka Offline OP
User
Zheka  Offline OP
User
Z

Joined: Jul 2017
Posts: 783
Quote:
It is probably a rounding error
It starts and ends 1 min earlier than it should.

Re: Bug in first bar of week construction [Re: Zheka] #471734
03/17/18 14:55
03/17/18 14:55
Joined: Jul 2017
Posts: 783
Z
Zheka Offline OP
User
Zheka  Offline OP
User
Z

Joined: Jul 2017
Posts: 783
JCL,

In 1.80.2 the above-mentioned bug is fixed.

However, a new bug appeared!

The bar is just skipped/not constructed despite data exist in the database, which screws further frame construction.
I suspect the reason is its o-h-l-c are all the same, but that's the way it indeed happened.

Attached Files Zorro_barconstruction_bug_2.PNG
Re: Bug in first bar of week construction [Re: Zheka] #471757
03/19/18 10:40
03/19/18 10:40
Joined: Jul 2000
Posts: 27,977
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,977
Frankfurt
We have not yet fixed or looked into it. Only the timestamp rounding was made slightly more restrictive in 1.80.2, for avoiding a bit more rounding errors. But we cannot round too much, or else we lose precision.

O-H-L-C all the same is normal and not a bug.

Re: Bug in first bar of week construction [Re: jcl] #471760
03/19/18 11:58
03/19/18 11:58
Joined: Jul 2017
Posts: 783
Z
Zheka Offline OP
User
Zheka  Offline OP
User
Z

Joined: Jul 2017
Posts: 783
What is meant by "rounding"?
These are historical M1 data with exact timestamps, already rounded to a whole minute.
Anyway, it has to be verified and confirmed that the first bar of the week starts on time and is of duration specified by BarPeriod/BarOffset.

Quote:
O-H-L-C, all the same, is normal and not a bug.
Sure. I did not imply it is.

The bug is that a bar is not constructed/is skipped, despite data exist in a database.

Please have a look at the screenshot.

Re: Bug in first bar of week construction [Re: Zheka] #471780
03/19/18 17:49
03/19/18 17:49
Joined: Jul 2000
Posts: 27,977
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,977
Frankfurt
Sorry, I meant "not causing a bug".

Rounding applies a small time delay to any timestamp for avoiding rounding errors like this one that you reported here.

Re: Bug in first bar of week construction [Re: jcl] #471899
03/24/18 13:48
03/24/18 13:48
Joined: Jul 2017
Posts: 783
Z
Zheka Offline OP
User
Zheka  Offline OP
User
Z

Joined: Jul 2017
Posts: 783
JCL,

in 1.80.6 this bug is still present.

I can understand rounding in live trading where timestamps are determined on-the-go, but timestamps of historical data are unambiguous...

If ZHistoryEditor displays raw data correctly, then - what's the problem?
Such basic functionality should be reliable...One way or another.

Re: Bug in first bar of week construction [Re: Zheka] #471929
03/27/18 07:45
03/27/18 07:45
Joined: Jul 2000
Posts: 27,977
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,977
Frankfurt
Rounding is needed for any data series that is sampled in fixed time intervals. Since the timestamps have random fluctuations and can end up right or left of a minute boundary, trading platforms round them down by applying a time offset. Has nothing to do with live trading. - Update: We could confirm the rounding issue. It will be fixed in the next release. A bug with a skipped bar could not be reproduced. If you think you got a wrong bar, please post that script here or send it to support.

Re: Bug in first bar of week construction [Re: jcl] #472018
04/02/18 12:27
04/02/18 12:27
Joined: Jul 2017
Posts: 783
Z
Zheka Offline OP
User
Zheka  Offline OP
User
Z

Joined: Jul 2017
Posts: 783
Yes, I embarked on exporting data from IB/ importing into Zorro myself and did stumble on this very issue: all bars got shifted until I added 100ms to the timestamps...
But this has probably more to do with the exactness of float/double representation, isnt' it?

It probably makes sense to have different rounding algorithms for historical data and live data.

Quote:
If you think you got a wrong bar, please post that script here or send it to support
How can a script possibly influence bar formation by Zorro?

I would rather retest after the basic rounding fix is implemented and then report again.


Moderated by  jcl, Nems, Spirit, Tobias 

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1