Gamestudio Links
Zorro Links
Newest Posts
folder management functions
by 7th_zorro. 04/16/24 13:19
lookback setting performance issue
by 7th_zorro. 04/16/24 03:08
zorro 64bit command line support
by 7th_zorro. 04/15/24 09:36
Zorro FIX plugin - Experimental
by flink. 04/14/24 07:48
Zorro FIX plugin - Experimental
by flink. 04/14/24 07:46
LPDIRECT3DCUBETEXTUR
E9

by Ayumi. 04/12/24 11:00
Sam Foster Sound | Experienced Game Composer for Hire
by titanicpiano14. 04/11/24 14:56
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
3 registered members (rki, Ayumi, Quad), 490 guests, and 0 spiders.
Key: Admin, Global Mod, Mod
Newest Members
11honza11, ccorrea, sakolin, rajesh7827, juergen_wue
19045 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,978
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,978
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,724
Chicago
AndrewAMD Offline
Serious User
AndrewAMD  Offline
Serious User

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

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,978
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