Gamestudio Links
Zorro Links
Newest Posts
adviseLong returns 0 with custom Objective
by tomaslolo
Yesterday at 23:35
OptimalF factors for every step of WFO?
by AndrewAMD
Yesterday at 21:27
Is it possible to beat 50/50 with equal risk/reward?
by Nexow
Yesterday at 17:28
Help with Wine on Linux
by jcl
Yesterday at 11:28
Sam Foster Sound | Experienced Game Composer for Hire
by titanicpiano14
04/24/19 17:09
Stock Splits
by jcl
04/24/19 08:37
Thinking about Multiplayer
by kmega00
04/23/19 23:53
AUM Magazine
Latest Screens
The Space Between
Pogostuck: Rage With Your Friends
Worst Case Z
AckCon'18 - Lotter vs the World 2 - Preview Release
Who's Online
8 registered (AndrewAMD, ugofx, Zheka, tomaslolo, Ayumi, Uhrwerk, 2 invisible), 156 Guests and 6 Spiders online.
Key: Admin, Global Mod, Mod
Newest Members
zol, AlbertRUF, Zoltar, Bill_Lin_Fang, michaelj
18210 Registered Users
Topic Options
Rate This Topic
#474370 - 10/10/18 09:08 Functions: dayOpen/dayClose - BarPeriod
kerplunk1899 Offline

Registered: 09/26/18
Posts: 11
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!

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

Chief Engineer

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


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

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