Gamestudio Links
Zorro Links
Newest Posts
Alternative to Stooq for Zorro S
by cwford. 10/09/26 21:13
Stooq now requires an API key
by cwford. 10/08/26 23:27
ZorroGPT
by TipmyPip. 10/06/26 05:32
Purchase A8 full licence version
by jcl. 10/05/26 12:12
AUM Magazine
Latest Screens
Dorifto samurai
Shadow 2
Rocker`s Revenge
Stug 3 Stormartillery
Who's Online Now
1 registered members (ukgamer), 11,678 guests, and 5 spiders.
Key: Admin, Global Mod, Mod
Newest Members
JimSimons, julienp, julienper, KelleyAbbey, Yopachi
19246 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
minutesWithin() or who to know time elapsed inside a bar #472629
05/08/18 22:47
05/08/18 22:47
Joined: Nov 2017
Posts: 34
C
Cheulmen Offline OP
Newbie
Cheulmen  Offline OP
Newbie
C

Joined: Nov 2017
Posts: 34
Hi, I'm trying to know, while I'm using tick(), how many minutes has been since the bar started. Probably what I need is minutesWithin(), but I'm not using it correctly, I think. If I have BarPeriod=2, and I call minutesWithin from inside a tick() function , I should get (AFAIK) only values of 0, 1 or 2 as much. But I get the following values, depending on the parameters:

printf("n %f", minutesWithin(0));
results in a range from 377.424653 to 1.522134

I don't understand this value of 377 (as I'm using Barperiod=2 it shouldn't be higher than that).

I want just to calculate inside a tmf() or a tick() if in the next minute is going to run() a new bar. So for example I want, If I have a BarPeriod=120, and a tick is called repeated times during that bar, knowing if it is the minute 119 inside that bar.

I guess that minutesAgo() could be of help also, but I don't get how to use it.

Re: minutesWithin() or who to know time elapsed inside a bar [Re: Cheulmen] #472638
05/09/18 09:22
05/09/18 09:22
Joined: Jul 2000
Posts: 28,140
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 28,140
Frankfurt
Aside from minutesWithin(), you can also simply get the current time inside the tick() function, and subtract the time from one bar before.

For obvious reasons, no matter how small your bar period, minutesWithin() can, and often will, return ranges of up to about 3000 minutes. BarPeriod=2 gives only the MINIMUM length of a bar.

Re: minutesWithin() or who to know time elapsed inside a bar [Re: jcl] #472642
05/09/18 16:36
05/09/18 16:36
Joined: Nov 2017
Posts: 34
C
Cheulmen Offline OP
Newbie
Cheulmen  Offline OP
Newbie
C

Joined: Nov 2017
Posts: 34
Do you mean saying that BarPeriod=2 gives the minimum length, that it could be bigger because the use of TimeFrame?

Re: minutesWithin() or who to know time elapsed inside a bar [Re: Cheulmen] #472643
05/09/18 19:38
05/09/18 19:38
Joined: Sep 2003
Posts: 938
Spirit Offline

Moderator
Spirit  Offline

Moderator

Joined: Sep 2003
Posts: 938
A bar is at least as long as the time between 2 price ticks.


Moderated by  Petra 

Powered by UBB.threads™ PHP Forum Software 7.7.1