Gamestudio Links
Zorro Links
Newest Posts
Help!
by VoroneTZ. 10/14/25 05:04
Zorro 2.70
by jcl. 10/13/25 09:01
ZorroGPT
by TipmyPip. 10/12/25 13:58
Sam Foster Sound | Experienced Game Composer for Hire
by titanicpiano14. 10/11/25 18:45
Reality Check results on my strategy
by dBc. 10/11/25 06:15
optimize global parameters SOLVED
by dBc. 09/27/25 17:07
AUM Magazine
Latest Screens
Rocker`s Revenge
Stug 3 Stormartillery
Iljuschin 2
Galactic Strike X
Who's Online Now
1 registered members (VoroneTZ), 9,291 guests, and 1 spider.
Key: Admin, Global Mod, Mod
Newest Members
joenxxx, Jota, krishna, DrissB, James168
19170 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
tdm() in BarZone time vs day/month in UTC #484895
12/27/21 18:42
12/27/21 18:42
Joined: Jul 2017
Posts: 787
Z
Zheka Offline OP
User
Zheka  Offline OP
User
Z

Joined: Jul 2017
Posts: 787
I found that tdm()/tom() are based off BarZone time while day()/month() functions are off UTC.

This creates a situation where for BarZone=ET, the time period from 00 to 400/500 UTC technically belongs to the ' last trading day' according to tdm() but is already the 'first day' according to day().
Not expected and illogical.

Can this inconsistency please be resolved in some way?

Why don't all time/date functions respect BarZone (i.e. return time in BarZone time by default)?

It might make sense to make tdm() respect EndMarket (which is in BarZone time)...With EndMarket=1700ET, 1800 ET will belong to the next trading day - which it is..

Last edited by Zheka; 12/27/21 18:49.
Re: tdm() in BarZone time vs day/month in UTC [Re: Zheka] #484903
12/28/21 14:43
12/28/21 14:43
Joined: Jul 2000
Posts: 28,028
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 28,028
Frankfurt
I must agree that it is a bit inconsistent. But for obvious reasons we cannot change existing functions. Solve it by script: set BarZone to UTC before calling tdm() or tom(), and set it back afterwards.

Or use the local day number, which is day(ldate(BarZone,0)).

Re: tdm() in BarZone time vs day/month in UTC [Re: Zheka] #484907
12/28/21 16:05
12/28/21 16:05
Joined: Jul 2017
Posts: 787
Z
Zheka Offline OP
User
Zheka  Offline OP
User
Z

Joined: Jul 2017
Posts: 787
The manual (currently) states that BarZone 'Affects the generation of bars, similar to BarOffset" and "BarZone, HistoryZone, and BrokerZone affect the sampling of bars and thus must not be changed anymore after selecting the asset"..

Feeding day() with the local date should work; thank you.

Last edited by Zheka; 12/28/21 16:52.
Re: tdm() in BarZone time vs day/month in UTC [Re: Zheka] #484914
12/29/21 10:10
12/29/21 10:10
Joined: Jul 2000
Posts: 28,028
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 28,028
Frankfurt
You have my special permission to change BarZone in that case.

Re: tdm() in BarZone time vs day/month in UTC [Re: Zheka] #484922
12/30/21 13:51
12/30/21 13:51
Joined: Jul 2017
Posts: 787
Z
Zheka Offline OP
User
Zheka  Offline OP
User
Z

Joined: Jul 2017
Posts: 787
Will the new BR_ASSET mode affect tdm()? So that AssetMarketEnd determines the tdm end?

Re: tdm() in BarZone time vs day/month in UTC [Re: Zheka] #484924
12/30/21 14:21
12/30/21 14:21
Joined: Jul 2000
Posts: 28,028
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 28,028
Frankfurt
No, it does not affect existing functions. You can set EndMarket = AssetMarketEnd for tdm().

Re: tdm() in BarZone time vs day/month in UTC [Re: jcl] #484928
12/30/21 16:45
12/30/21 16:45
Joined: Jul 2017
Posts: 787
Z
Zheka Offline OP
User
Zheka  Offline OP
User
Z

Joined: Jul 2017
Posts: 787
Originally Posted by jcl
You can set EndMarket = AssetMarketEnd for tdm().
This will result in what behavior?

Last edited by Zheka; 12/30/21 16:45.

Moderated by  Petra 

Gamestudio download | 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