Gamestudio Links
Zorro Links
Newest Posts
Respect History setting for Z systems
by Zheka. 10/02/26 11:36
Purchase A8 full licence version
by ukgamer. 10/02/26 01:31
A3 projects
by Yopachi. 09/28/26 17:04
Parent/child object
by rayp. 09/27/26 14:43
AUM Magazine
Latest Screens
Dorifto samurai
Shadow 2
Rocker`s Revenge
Stug 3 Stormartillery
Who's Online Now
4 registered members (AndrewAMD, 3run, julienp, 1 invisible), 5,607 guests, and 0 spiders.
Key: Admin, Global Mod, Mod
Newest Members
julienp, julienper, KelleyAbbey, Yopachi, Knull
19245 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Time functions with manually set Bar #485992
05/25/22 13:48
05/25/22 13:48
Joined: Jul 2017
Posts: 788
Z
Zheka Offline OP
User
Zheka  Offline OP
User
Z

Joined: Jul 2017
Posts: 788
In this snippet in EXITRUN/ evaluate():

for (Bar=X; Bar<Y; Bar++) {
watch("! tod=", tod(0), priceC(0) );
}
the returned close price IS changing in line with changing Bar, but not tod.

This looks inconsistent.


Last edited by Zheka; 05/25/22 13:49.
Re: Time functions with manually set Bar [Re: Zheka] #485993
05/25/22 14:03
05/25/22 14:03
Joined: Jul 2017
Posts: 788
Z
Zheka Offline OP
User
Zheka  Offline OP
User
Z

Joined: Jul 2017
Posts: 788
for (Bar=X; Bar<Y; Bar++) {
int bOff = NumBars-1 - Bar;

watch("! ltod=", ltod(ET, bOff) );
}

doesn't work either.

Re: Time functions with manually set Bar [Re: Zheka] #485994
05/25/22 19:45
05/25/22 19:45
Joined: Apr 2008
Posts: 601
Austria
Petra Offline
Support
Petra  Offline
Support

Joined: Apr 2008
Posts: 601
Austria
https://zorro-project.com/manual/en/numbars.htm

Bar is the current bar index. Overwriting the current bar index is probably no good idea.

All price and time functions have offset parameters.

Re: Time functions with manually set Bar [Re: Zheka] #485999
05/25/22 22:06
05/25/22 22:06
Joined: Jul 2017
Posts: 788
Z
Zheka Offline OP
User
Zheka  Offline OP
User
Z

Joined: Jul 2017
Posts: 788
I am not 'overwriting' the current bar index. I am going through Bars manually once again in EXITRUN (i recall manual mentions such possibility of manually changing the Bar index; and it works).

All price and time functions have offset parameters. - Right. And - as expected - priceClose(0) does return the close price of the set Bar, but neither tod(0) nor tod(NumBars-1-Bar) do.


Moderated by  Petra 

Powered by UBB.threads™ PHP Forum Software 7.7.1