Gamestudio Links
Zorro Links
Newest Posts
Blobsculptor tools and objects download here
by NeoDumont. 03/28/24 03:01
Issue with Multi-Core WFO Training
by aliswee. 03/24/24 20:20
Why Zorro supports up to 72 cores?
by Edgar_Herrera. 03/23/24 21:41
Zorro Trader GPT
by TipmyPip. 03/06/24 09:27
VSCode instead of SED
by 3run. 03/01/24 19:06
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
2 registered members (Quad, aliswee), 835 guests, and 5 spiders.
Key: Admin, Global Mod, Mod
Newest Members
sakolin, rajesh7827, juergen_wue, NITRO_FOREVER, jack0roses
19043 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Return current bar in Unix time #477143
05/24/19 05:32
05/24/19 05:32
Joined: Nov 2018
Posts: 55
G
gamadeus Offline OP
Junior Member
gamadeus  Offline OP
Junior Member
G

Joined: Nov 2018
Posts: 55
Hello,

I am struggling to get Zorro to return the current bar in Unix time.
Apparently that can be done via utm() but I have trouble finding the correct var Date to feed.

Can someone help me with that?

Re: Return current bar in Unix time [Re: gamadeus] #477146
05/24/19 11:04
05/24/19 11:04
Joined: Jul 2000
Posts: 27,977
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,977
Frankfurt
utm(wdate(0))

Re: Return current bar in Unix time [Re: jcl] #477199
05/30/19 11:15
05/30/19 11:15
Joined: Nov 2018
Posts: 55
G
gamadeus Offline OP
Junior Member
gamadeus  Offline OP
Junior Member
G

Joined: Nov 2018
Posts: 55
Thanks Jcl!

One problem though I have with this is that when I run this in Trademode under FRISTRUN it will not give me the current bar and timestamp but the first Lookback bar.

Is there any way to just get the current timestamp in that format without any bar offset required?

And a related question: is there a flag similar to FIRSTRUN that is triggered on the first bar after the Lookback period?

Re: Return current bar in Unix time [Re: gamadeus] #477200
05/30/19 14:04
05/30/19 14:04
Joined: Jul 2017
Posts: 783
Z
Zheka Offline
User
Zheka  Offline
User
Z

Joined: Jul 2017
Posts: 783

if (!is(LOOKBACK))
{
}

Re: Return current bar in Unix time [Re: Zheka] #477201
05/30/19 14:23
05/30/19 14:23
Joined: Nov 2018
Posts: 55
G
gamadeus Offline OP
Junior Member
gamadeus  Offline OP
Junior Member
G

Joined: Nov 2018
Posts: 55
yes thanks of course I am aware of that.
but I want to know if there is a flag similar to INITRUN for Lookback, because !is(LOOKBACK) is true for every run after the lookback period

Re: Return current bar in Unix time [Re: gamadeus] #477204
05/30/19 16:09
05/30/19 16:09
Joined: Feb 2017
Posts: 1,718
Chicago
AndrewAMD Online
Serious User
AndrewAMD  Online
Serious User

Joined: Feb 2017
Posts: 1,718
Chicago

Re: Return current bar in Unix time [Re: AndrewAMD] #477205
05/30/19 16:24
05/30/19 16:24
Joined: Nov 2018
Posts: 55
G
gamadeus Offline OP
Junior Member
gamadeus  Offline OP
Junior Member
G

Joined: Nov 2018
Posts: 55
thanks a lot Andrew, should have realized that myself!

Re: Return current bar in Unix time [Re: gamadeus] #479375
03/25/20 14:28
03/25/20 14:28
Joined: Feb 2020
Posts: 3
T
Trader_Joey Offline
Guest
Trader_Joey  Offline
Guest
T

Joined: Feb 2020
Posts: 3
i have managed to get the timestamp of the last tick with utm(wdate(0)). But as far as i can see this only returns the Unix time in seconds, not in milliseconds. Is there any way to receive the Unix time stamp in milliseconds?

Re: Return current bar in Unix time [Re: gamadeus] #479381
03/25/20 16:51
03/25/20 16:51
Joined: Jul 2000
Posts: 27,977
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,977
Frankfurt
You can directly convert it to ms, this is the formula:

Unix_ms = (wdate(0)-25569.)*(24*60*60*1000)

Re: Return current bar in Unix time [Re: gamadeus] #479382
03/25/20 17:08
03/25/20 17:08
Joined: Feb 2020
Posts: 3
T
Trader_Joey Offline
Guest
Trader_Joey  Offline
Guest
T

Joined: Feb 2020
Posts: 3
Thanks for the help!


Moderated by  Petra 

Powered by UBB.threads™ PHP Forum Software 7.7.1