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
0 registered members (), 984 guests, and 5 spiders.
Key: Admin, Global Mod, Mod
Newest Members
LucasJoshua, Baklazhan, Hanky27, firatv, wandaluciaia
19053 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Own logfile / show "optional decimals" on seconds #484845
12/16/21 15:29
12/16/21 15:29
Joined: Dec 2021
Posts: 12
Z
Zendrix Offline OP
Newbie
Zendrix  Offline OP
Newbie
Z

Joined: Dec 2021
Posts: 12
Hello world,
I am very new to Zorro.
I successfully transferred some of my trading setups from InvestoxPlattform to Zorro, but I am struggling to activate a time-function found in the Zorro manual :

To align some self-made Logfile operations via :

file_append("Data\\ABC-LOG.txt",strf( "\n%s UTC", strdate("%d.%m.%Y %a %H:%M:%S UTC",ldate(0,0) ) ), 0)

the results show up as requested in my Logfile-rows :

16.12.2021 Thu 10:35:17 UTC ...
16.12.2021 Thu 10:35:24 UTC ...

Furthermore I would like to have the available fractional-seconds shown in my Logfile to compare Events more precisely.
In the Zorro manual part __Format Codes - C Programmer's Cheat Sheet__ I found the parameter %S to be able to show fractional seconds :

It says:

(...)

%S Second with optional decimals (00..59 or 00.000000 .. 59.999999)

(...)

Does somebody know, how to activated the "optional decimals" via the %S parameter ?

Regards
Hendrix

Re: Own logfile / show "optional decimals" on seconds [Re: Zendrix] #484846
12/16/21 17:23
12/16/21 17:23
Joined: Apr 2008
Posts: 586
Austria
Petra Offline
Support
Petra  Offline
Support

Joined: Apr 2008
Posts: 586
Austria
Windows printing rounds OLE dates to full seconds. You must use Zorro functions, like dataParse() for reading and second() for printing decimals.

printf("%.3f",second(Date));

Re: Own logfile / show "optional decimals" on seconds [Re: Petra] #484849
12/18/21 09:19
12/18/21 09:19
Joined: Dec 2021
Posts: 12
Z
Zendrix Offline OP
Newbie
Zendrix  Offline OP
Newbie
Z

Joined: Dec 2021
Posts: 12
Hello Petra,

thank you for your help. Knowing your advise and reading the related part of the manual again, I found and understand the hint "rounds to full seconds".

Now using

string zeittext1 = strdate("%d.%m.%Y %a %H:%M",ldate(0,0) );
string zeittext2 = strf("%08.5f",second(ldate(0,0)));
file_append("Data\\ABC-LOG.txt",strf("\n%s:%s UTC ...",zeittext1,zeittext2,...), 0);

results in exactly what I need :

17.12.2021 Thu 12:45:02:43265 UTC ...
17.12.2021 Thu 12:45:09:62231 UTC ...

Regards
Hendrix


Moderated by  Petra 

Powered by UBB.threads™ PHP Forum Software 7.7.1