Gamestudio Links
Zorro Links
Newest Posts
optimize global parameters SOLVED
by dBc. 09/27/25 17:07
ZorroGPT
by TipmyPip. 09/27/25 10:05
Release 2.68 replacement of the .par format
by Martin_HH. 09/23/25 20:48
assetHistory one candle shift
by jcl. 09/21/25 11:36
Plugins update
by Grant. 09/17/25 16:28
AUM Magazine
Latest Screens
Rocker`s Revenge
Stug 3 Stormartillery
Iljuschin 2
Galactic Strike X
Who's Online Now
1 registered members (dBc), 17,971 guests, and 5 spiders.
Key: Admin, Global Mod, Mod
Newest Members
krishna, DrissB, James168, Ed_Love, xtns
19168 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: 787
Z
Zheka Offline OP
User
Zheka  Offline OP
User
Z

Joined: Jul 2017
Posts: 787
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: 787
Z
Zheka Offline OP
User
Zheka  Offline OP
User
Z

Joined: Jul 2017
Posts: 787
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: 594
Austria
Petra Offline
Support
Petra  Offline
Support

Joined: Apr 2008
Posts: 594
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: 787
Z
Zheka Offline OP
User
Zheka  Offline OP
User
Z

Joined: Jul 2017
Posts: 787
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