Gamestudio Links
Zorro Links
Newest Posts
Loging off automatically ?
by old_bill. 03/30/20 22:07
Need help to log in my broker into ZORRO
by buttcorgi. 03/30/20 19:52
textureLod into HLSL
by 3run. 03/30/20 18:01
Running banchmark test with FxPro on MT4
by Cobus. 03/30/20 14:55
Read Z12.fac while running Z2
by AndrewAMD. 03/29/20 22:32
Comment Out
by danatrader. 03/29/20 22:03
AUM Magazine
Latest Screens
The Space Between
Pogostuck: Rage With Your Friends
Worst Case Z
AckCon'18 - Lotter vs the World 2 - Preview Release
Who's Online Now
9 registered members (AndrewAMD, jbhunter, alibaba, 3run, buttcorgi, Ayumi, marsz, Lozoteva, 1 invisible), 669 guests, and 6 spiders.
Key: Admin, Global Mod, Mod
Newest Members
gonzalez21, Cobus, HF_Psy, jj02520024, heitorfr
18409 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: 54
G
gamadeus Offline OP
Junior Member
gamadeus  Offline OP
Junior Member
G

Joined: Nov 2018
Posts: 54
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,148
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,148
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: 54
G
gamadeus Offline OP
Junior Member
gamadeus  Offline OP
Junior Member
G

Joined: Nov 2018
Posts: 54
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: 421
Z
Zheka Offline
Senior Member
Zheka  Offline
Senior Member
Z

Joined: Jul 2017
Posts: 421

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: 54
G
gamadeus Offline OP
Junior Member
gamadeus  Offline OP
Junior Member
G

Joined: Nov 2018
Posts: 54
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: 895
Chicago
AndrewAMD Online
User
AndrewAMD  Online
User

Joined: Feb 2017
Posts: 895
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: 54
G
gamadeus Offline OP
Junior Member
gamadeus  Offline OP
Junior Member
G

Joined: Nov 2018
Posts: 54
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,148
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

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


Powered by UBB.threads™ PHP Forum Software 7.7.1