Gamestudio Links
Zorro Links
Newest Posts
Zorro 2.70
by jcl. 09/29/25 09:24
optimize global parameters SOLVED
by dBc. 09/27/25 17:07
ZorroGPT
by TipmyPip. 09/27/25 10:05
assetHistory one candle shift
by jcl. 09/21/25 11:36
Plugins update
by Grant. 09/17/25 16:28
AUM Magazine
Latest Screens
Rocker`s Revenge
Stug 3 Stormartillery
Iljuschin 2
Galactic Strike X
Who's Online Now
1 registered members (TipmyPip), 18,484 guests, and 6 spiders.
Key: Admin, Global Mod, Mod
Newest Members
krishna, DrissB, James168, Ed_Love, xtns
19168 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
BarOffset and DST #485742
04/18/22 20:03
04/18/22 20:03
Joined: Aug 2021
Posts: 101
M
MegaTanker Offline OP
Member
MegaTanker  Offline OP
Member
M

Joined: Aug 2021
Posts: 101
Greetings. I look into deploying a strategy that evaluates daily bars of US equities once per day. The default BarOffset of 940 would then sample the bars at 15:40 UTC, which if I am not mistaken would occur 10 minutes after open in winter months. But during summer months with DST, the market opens at 14:30 UTC. Does that mean Zorro would still sample at 15:40 UTC, so 70 minutes after open? Can I correct for this in the script by setting BarOffset depending on what dst() returns or is this variable read only once the session has started?

Re: BarOffset and DST [Re: MegaTanker] #485743
04/18/22 23:37
04/18/22 23:37
Joined: Jul 2017
Posts: 787
Z
Zheka Offline
User
Zheka  Offline
User
Z

Joined: Jul 2017
Posts: 787
BarZone=ET;
BarOffset=16*60;
BarPeriod=1440;

Re: BarOffset and DST [Re: MegaTanker] #485753
04/19/22 08:08
04/19/22 08:08
Joined: Aug 2021
Posts: 101
M
MegaTanker Offline OP
Member
MegaTanker  Offline OP
Member
M

Joined: Aug 2021
Posts: 101
BarZone looks like what I need but it doesn't seem to be doing anything. The timestamps of the bars in the chart remain unchanged and when I try triggering something with the hour() function, it still uses the default timezone. Tried various settings, EST, CET and just integers

Re: BarOffset and DST [Re: MegaTanker] #485754
04/19/22 08:21
04/19/22 08:21
Joined: Jul 2017
Posts: 787
Z
Zheka Offline
User
Zheka  Offline
User
Z

Joined: Jul 2017
Posts: 787
Look in the log for timestamps, not chart (of daily? bars). If you indeed use daily bars, how/why would you "trigger something" based on hour()? Look in the manual for hour() (and 1 line beneath).

Re: BarOffset and DST [Re: MegaTanker] #485755
04/19/22 08:48
04/19/22 08:48
Joined: Aug 2021
Posts: 101
M
MegaTanker Offline OP
Member
MegaTanker  Offline OP
Member
M

Joined: Aug 2021
Posts: 101
I used hour bars just to test how BarZone behaves, to better understand it. Even the logfile still has the first bar at 15:00 with BarZone set to EST, same as with BarZone set to UTC.

Perusing the manual, I found a line in the release history, which says "The BarZone variable can be used to shift daily bars to a certain local time zone." So I guess this feature is designed only for daily bars. Then it makes sense that hourly bars don't work.

Re: BarOffset and DST [Re: MegaTanker] #485757
04/19/22 10:11
04/19/22 10:11
Joined: Apr 2008
Posts: 594
Austria
Petra Offline
Support
Petra  Offline
Support

Joined: Apr 2008
Posts: 594
Austria
https://zorro-project.com/manual/en/log.htm

BarZone is for all bars. But of course you would see no different bar timestamps in the log when you use 1H bars.


Moderated by  Petra 

Powered by UBB.threads™ PHP Forum Software 7.7.1