Gamestudio Links
Zorro Links
Newest Posts
Data from CSV not parsed correctly
by EternallyCurious. 04/18/24 10:45
StartWeek not working as it should
by Zheka. 04/18/24 10:11
folder management functions
by VoroneTZ. 04/17/24 06:52
lookback setting performance issue
by 7th_zorro. 04/16/24 03:08
zorro 64bit command line support
by 7th_zorro. 04/15/24 09:36
Zorro FIX plugin - Experimental
by flink. 04/14/24 07:48
Zorro FIX plugin - Experimental
by flink. 04/14/24 07:46
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
1 registered members (SBGuy), 652 guests, and 3 spiders.
Key: Admin, Global Mod, Mod
Newest Members
EternallyCurious, howardR, 11honza11, ccorrea, sakolin
19047 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Understanding Zorro: restrictions of the order of commands #485848
04/28/22 08:36
04/28/22 08:36
Joined: Jan 2022
Posts: 58
N
NorbertSz Offline OP
Junior Member
NorbertSz  Offline OP
Junior Member
N

Joined: Jan 2022
Posts: 58
Hello,

Because of some incomprehensible behavior I narrow down the error to the following.

Code
function run(){
	asset("EURUSD");
	StartDate = NOW;
	printf("\nhello preload (%s)", Asset);
	if (!is(LOOKBACK)){
		printf("\nhello trading");
	}
}


The Zorro log writes a lot "hello preload (EURUSD)", but never go to "hello trading".

However in this case I see the "hello trading" message.
Code
function run(){
	StartDate = NOW;
	asset("EURUSD");
	printf("\nhello preload (%s)", Asset);
	if (!is(LOOKBACK)){
		printf("\nhello trading");
	}
}


It's totally illogical for me, and I'm trying to understand why is it possible. No error messages, Zorro can select the Asset (I see the "hello preload (EURUSD)" message), but just do not finishing the lookback period. Could someone explain this phenomenon?

Is there a guideline for dummies of other restrictions / rules about which statement should follow others?
Like this: "do not select the asset before setting up the startdate".

Also I think it would be great if Zorro could generate an error message if the order of statements is incorrect.

Thank you!
(Zorro S 2.44)

Last edited by NorbertSz; 04/28/22 08:39.
Re: Understanding Zorro: restrictions of the order of commands [Re: NorbertSz] #485849
04/28/22 08:42
04/28/22 08:42
Joined: Jul 2000
Posts: 27,978
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,978
Frankfurt
The order of commands matters in any programming language. In which way it matters is normally obvious, but not always. In such a case I'm afraid there's no way around reading the description in the manual. Especially the remarks in fat red letters.

https://zorro-project.com/manual/en/asset.htm

Zorro finds many such bugs, but not all. Although your start date setting makes here no sense, it could be correct under other circumstances, and therefore does not thrown an error.


Moderated by  Petra 

Powered by UBB.threads™ PHP Forum Software 7.7.1