Gamestudio Links
Zorro Links
Newest Posts
Data from CSV not parsed correctly
by EternallyCurious. 04/25/24 10:20
Trading Journey
by howardR. 04/24/24 20:04
M1 Oversampling
by Petra. 04/24/24 10:34
Zorro FIX plugin - Experimental
by flink. 04/21/24 07:12
Scripts not found
by juergen_wue. 04/20/24 18:51
zorro 64bit command line support
by 7th_zorro. 04/20/24 10:06
StartWeek not working as it should
by jcl. 04/20/24 08:38
folder management functions
by VoroneTZ. 04/17/24 06:52
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
3 registered members (AndrewAMD, SBGuy, Petra), 801 guests, and 8 spiders.
Key: Admin, Global Mod, Mod
Newest Members
Mega_Rod, EternallyCurious, howardR, 11honza11, ccorrea
19048 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,725
Chicago
AndrewAMD Online OP
Serious User
AndrewAMD  Online OP
Serious User

Joined: Feb 2017
Posts: 1,725
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,982
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,982
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,725
Chicago
AndrewAMD Online OP
Serious User
AndrewAMD  Online OP
Serious User

Joined: Feb 2017
Posts: 1,725
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,982
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,982
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,725
Chicago
AndrewAMD Online OP
Serious User
AndrewAMD  Online OP
Serious User

Joined: Feb 2017
Posts: 1,725
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