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 minutesWithin()? #470524
01/18/18 15:03
01/18/18 15:03
Joined: Jul 2017
Posts: 783
Z
Zheka Offline OP
User
Zheka  Offline OP
User
Z

Joined: Jul 2017
Posts: 783
As per manual,minutesWithin() is to return
Quote:
Total number of minutes from start to end of the bar with the given offset
It works as it should except for the first bar on Sunday.

Weekend=1, first available M1 "tick" on Sun is 2116 UTC.
Quote:
[1866: Fri 16-05-13 20:46] (122.80) Skiping.. minWithin= 5.0, skipBars= -2

[1867: Fri 16-05-13 20:51] (122.80)time= 1651
[1868: Fri 16-05-13 20:56] (122.82)time= 1656
[1869: Fri 16-05-13 21:01] (122.99)time= 1701

[1870: Sun 16-05-15 21:21] (122.85) Skiping.. minWithin= 2900.0, skipBars= -1

[1871: Sun 16-05-15 21:26] (122.86) Skiping.. minWithin= 5.0, skipBars= -1

2900 minutes is exactly the time to the end of the previous bar on Friday, not to open at 2116 on Sun.

Re: Bug in minutesWithin()? [Re: Zheka] #470536
01/19/18 07:45
01/19/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
A bar has a start and an end. When a bar ends, the next bar starts. Your weekend bar started Friday 21:01 and ended Sunday 21:21. Weekend bars are long and 2900 minutes are perfectly normal.

Re: Bug in minutesWithin()? [Re: jcl] #470539
01/19/18 12:18
01/19/18 12:18
Joined: Jul 2017
Posts: 783
Z
Zheka Offline OP
User
Zheka  Offline OP
User
Z

Joined: Jul 2017
Posts: 783
>>When a bar ends, the next bar starts<<
That's not an "obvious assumption"; nor is it conventionally used. Anyway, now I know.

Out of curiosity and wanting to learn:
- a (potentially) big, 2900-min bar is clearly uncomparable to, eg. a 60-min bar. How do you conceptually view it and handle such irregularity in a price series?

E.g. I use sometimes an MA of the range, not average true range. And such an irregular bar would screw the calculation, especially a recursive one like ExMA.

Calculations that only use Close will not be affected, but things using High/Low will be.

- What will be the price() calculation for "weekend" bars?

Re: Bug in minutesWithin()? [Re: Zheka] #470542
01/19/18 14:21
01/19/18 14:21
Joined: Jul 2000
Posts: 27,977
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,977
Frankfurt
price() is the mean price of the bar. Bar length irregularity is not evaluated in trading systems, except for special cases where tick density or sampling frequency is important.

Re: Bug in minutesWithin()? [Re: jcl] #470543
01/19/18 14:36
01/19/18 14:36
Joined: Jul 2017
Posts: 783
Z
Zheka Offline OP
User
Zheka  Offline OP
User
Z

Joined: Jul 2017
Posts: 783
Ok, not length per se, but a range?

Re: Bug in minutesWithin()? [Re: Zheka] #470544
01/19/18 14:40
01/19/18 14:40
Joined: Jul 2000
Posts: 27,977
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,977
Frankfurt
Depends on long term or short term, and for what you need the range. For a very short term range, such as 2 or 3 bars, tick density can indeed play a role.


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