Gamestudio Links
Zorro Links
Newest Posts
AlpacaZorroPlugin v1.3.0 Released
by kzhao. 05/22/24 13:41
Free Live Data for Zorro with Paper Trading?
by AbrahamR. 05/18/24 13:28
Change chart colours
by 7th_zorro. 05/11/24 09:25
Data from CSV not parsed correctly
by dr_panther. 05/06/24 18:50
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
2 registered members (AndrewAMD, Ayumi), 853 guests, and 5 spiders.
Key: Admin, Global Mod, Mod
Newest Members
lorikob361, LucasJoshua, Baklazhan, Hanky27, firatv
19054 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Use any DATE as "offset" input for time functions #477689
07/21/19 21:14
07/21/19 21:14
Joined: Feb 2017
Posts: 1,731
Chicago
AndrewAMD Online OP
Serious User
AndrewAMD  Online OP
Serious User

Joined: Feb 2017
Posts: 1,731
Chicago
jcl,

There are several time and calendar functions, here:
https://manual.zorro-project.com/month

As an input, the user can currently supply offset=NOW, or any given bar offset.

It would be nice if any arbitrary date can be used as an input as well.

It can be as simple as this:
New function: void setThisDate(var Date); // This sets the Date referenced by offset=THISDATE

Now you use the newly defined offset=THISDATE to use any of these date functions with any date.

Thanks,
Andrew

Re: Use any DATE as "offset" input for time functions [Re: AndrewAMD] #477695
07/22/19 05:40
07/22/19 05:40
Joined: Jul 2000
Posts: 27,986
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,986
Frankfurt
What's wrong with the current offset = Date method?

Re: Use any DATE as "offset" input for time functions [Re: AndrewAMD] #477700
07/22/19 10:20
07/22/19 10:20
Joined: Feb 2017
Posts: 1,731
Chicago
AndrewAMD Online OP
Serious User
AndrewAMD  Online OP
Serious User

Joined: Feb 2017
Posts: 1,731
Chicago
If I understand, the DATE input only allows int input and therefore I cannot use time of day functions, only daily. I was hoping to use the full var for time of day calculations, using time zones.

If it's easier, maybe allow a unix time input, since it's already an int, but in seconds.

Re: Use any DATE as "offset" input for time functions [Re: AndrewAMD] #477704
07/23/19 07:15
07/23/19 07:15
Joined: Jul 2000
Posts: 27,986
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,986
Frankfurt
We plan overloaded time functions for a future version that accept vars. Currently you can set Now to a Date and then use NOW for the offset.

Re: Use any DATE as "offset" input for time functions [Re: AndrewAMD] #477708
07/23/19 10:23
07/23/19 10:23
Joined: Feb 2017
Posts: 1,731
Chicago
AndrewAMD Online OP
Serious User
AndrewAMD  Online OP
Serious User

Joined: Feb 2017
Posts: 1,731
Chicago
Thank you, and thanks for the workaround.


Moderated by  Petra 

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