Gamestudio Links
Zorro Links
Newest Posts
Indicator RSI
by sdelatorre
Yesterday at 23:16
Transaction Cost
by tradingest
Yesterday at 21:52
Is it possible to do Trade Mode without live brokerage account?
by AndrewAMD
Yesterday at 20:36
OptimialF values in .fac file mostly zero
by SBGuy
Yesterday at 19:48
MED (or any tool) - change base frame / pose of frame 0 ?
by rayp
Yesterday at 17:55
Rigid Force Alpha - Classic side-scrolling shoot'em up
by Turrican
Yesterday at 16:09
Series within loop
by Spirit
Yesterday at 13:22
AUM Magazine
Latest Screens
Worst Case Z
AckCon'18 - Lotter vs the World 2 - Preview Release
Evonet Beta v1.0 : Online Project Development Template
Lake scene
Who's Online
9 registered (AndrewAMD, alibaba, SBGuy, Superku, Quad, sdelatorre, 3 invisible), 460 Guests and 3 Spiders online.
Key: Admin, Global Mod, Mod
Newest Members
jiffdbf, jgtrader, Chefmac, BazGen, pallab1964
18079 Registered Users
Topic Options
Rate This Topic
#470524 - 01/18/18 16:03 Bug in minutesWithin()?
Zheka Offline
Senior Member

Registered: 07/03/17
Posts: 326
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.

Top
#470536 - 01/19/18 08:45 Re: Bug in minutesWithin()? [Re: Zheka]
jcl Offline

Chief Engineer

Registered: 07/22/00
Posts: 26529
Loc: 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.

Top
#470539 - 01/19/18 13:18 Re: Bug in minutesWithin()? [Re: jcl]
Zheka Offline
Senior Member

Registered: 07/03/17
Posts: 326
>>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?

Top
#470542 - 01/19/18 15:21 Re: Bug in minutesWithin()? [Re: Zheka]
jcl Offline

Chief Engineer

Registered: 07/22/00
Posts: 26529
Loc: 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.

Top
#470543 - 01/19/18 15:36 Re: Bug in minutesWithin()? [Re: jcl]
Zheka Offline
Senior Member

Registered: 07/03/17
Posts: 326
Ok, not length per se, but a range?

Top
#470544 - 01/19/18 15:40 Re: Bug in minutesWithin()? [Re: Zheka]
jcl Offline

Chief Engineer

Registered: 07/22/00
Posts: 26529
Loc: 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.

Top


Moderator:  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