Gamestudio Links
Zorro Links
Newest Posts
How does Zorro handle new strategy/asset?
by jcl
0 seconds ago
Intercept Friday Daily Close
by Dalla
27 minutes 22 seconds ago
Montecarlo statistical mode parameter optimization
by brax
Today at 14:14
New Zorro v1.99.2
by jcl
Today at 14:03
automation
by MINER
Today at 13:37
What are you working on?
by CocaCola
Today at 02:42
About 1M entities!
by txesmi
Yesterday at 14:16
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
13 registered (AndrewAMD, Dalla, kvm, Realspawn, Hredot, mabro41, jenGs, brax, 3 invisible), 193 Guests and 9 Spiders online.
Key: Admin, Global Mod, Mod
Newest Members
Thomas_Thornton, rssflc, mahomed, bondz, Neil_G
18119 Registered Users
Topic Options
Rate This Topic
#474370 - 10/10/18 09:08 Functions: dayOpen/dayClose - BarPeriod
kerplunk1899 Offline
Newbie

Registered: 09/26/18
Posts: 8
Hi all,

first of all, thank you guys for your constant support.
The tool is amazing, I'm facing the trading world as a beginner, but the scripting factor makes it so much more exciting.

Here's my issue.
I'm trying to get the exact closing and opening prices of the day before.
I found on the manual these two function that firstly seem to fit perfectly.
I'm using them like this:
- dayOpen(UTC, 1)
- dayClose(UTC, 1)

I'm trying with EUR/USD.
What I found out is a different behaviour of the functions when different BarPeriod are set.

I usually work with a BarPeriod = 1, so I would like to get the priceClose of the bar at 23.59 of the day before.
When I set it like this tough, the prices returned by the functions don't look right at all.
If I try to set it equals to 1440, the prices look perfect and match to what is shown in the ZHistoryEdior.


Can you please explain me why?
Is there a way to solve the issue obtaining the Open and Close price of the day before even with a BarPeriod equals to 1?
Should I maybe make use of the TimeFrame variable?


Thanks so much!
Regards,
Luca

Top
#474385 - 10/11/18 08:46 Re: Functions: dayOpen/dayClose - BarPeriod [Re: kerplunk1899]
jcl Online

Chief Engineer

Registered: 07/22/00
Posts: 26658
Loc: Frankfurt
It`s normally the other way around: the higher the bar period, the lower the price resolution, including dayOpen/Close. You can check their code in indicators.c.

Top



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

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