Gamestudio Links
Zorro Links
Newest Posts
Data from CSV not parsed correctly
by dr_panther. 05/06/24 18:50
Help with plotting multiple ZigZag
by degenerate_762. 04/30/24 23:23
M1 Oversampling
by 11honza11. 04/30/24 08:16
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
3 registered members (ChrstphFr, AndrewAMD, dr_panther), 865 guests, and 4 spiders.
Key: Admin, Global Mod, Mod
Newest Members
firatv, wandaluciaia, Mega_Rod, EternallyCurious, howardR
19050 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: 784
Z
Zheka Offline OP
User
Zheka  Offline OP
User
Z

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

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

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

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