Gamestudio Links
Zorro Links
Newest Posts
WFO Training with parallel cores Zorro64
by Martin_HH. 02/23/26 10:49
ZorroGPT
by TipmyPip. 02/21/26 19:15
Camera always moves upwards?
by clonman. 02/21/26 09:29
Zorro version 3.0 prerelease!
by TipmyPip. 02/20/26 13:22
Sam Foster Sound | Experienced Game Composer for Hire
by titanicpiano14. 02/19/26 13:22
AUM Magazine
Latest Screens
Dorifto samurai
Shadow 2
Rocker`s Revenge
Stug 3 Stormartillery
Who's Online Now
3 registered members (TipmyPip, alx, Martin_HH), 6,129 guests, and 2 spiders.
Key: Admin, Global Mod, Mod
Newest Members
alx, ApprenticeInMuc, PatrickH90, USER0328, Sfrdragon
19199 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
adviseLong produces .c file with syntax error. #428952
09/06/13 04:52
09/06/13 04:52
Joined: Sep 2013
Posts: 504
California
G
GPEngine Offline OP
User
GPEngine  Offline OP
User
G

Joined: Sep 2013
Posts: 504
California
For my first post, Ich habe einen wanze gefunden.

The following simple Zorro program crashes in Train mode because it produces an invalid data/A_EURUSD_1.c file. It has a syntax error and cannot be compiled.

I do not claim this strategy is the holy grail laugh or event that it has any merit at all. But I do feel that Zorro should never produce a .c file with a syntax error. This problem is very difficult to debug on my side...

Code:
function run()
{
	NumYears = 1;
	AssetList = "AssetsUS.dta";
	LookBack = 440;
	
	set(RULES+TESTNOW);
	if(Train) {
		set(HEDGING);
		ExitTime = 10;
		} else {
		set(NFA);
		Stop = 100*PIP;
		TakeProfit = 100*PIP;  
	}
	
	NumWFOCycles = 5;
	Weekend = 1;
	BarPeriod = 1;	
	
	vars sar1 = series(SAR(0.01, 0.1));
	vars sar2 = series(SAR(0.02, 0.2));
	vars sar3 = series(SAR(0.03, 0.3));
	vars sar4 = series(SAR(0.04, 0.4));
	vars sar5 = series(SAR(0.05, 0.5));
	vars sar6 = series(SAR(0.06, 0.6));
	vars sar7 = series(SAR(0.07, 0.7));
	
	vars mdm1 = series(MinusDM(50));
	vars mdi1 = series(MinusDI(50));
	vars mdm2 = series(MinusDM(100));
	vars mdi2 = series(MinusDI(100));	
	vars mdm3 = series(MinusDM(200));
	
	if(adviseLong(DTREE, 0,
	sar1[0], sar2[0], sar3[0], sar4[0], sar5[0], sar6[0], sar7[0],
	mdm1[0], mdi1[0], mdm2[0], mdi2[0], mdm3[0]) > 0){
		reverseLong(1);
	}
	if(adviseShort() > 0){
		reverseShort(1);
	}
}



In Train mode with EUR/USD selected, it produces a code/A_EURUSD_1.c file containing the following nonsense lines

Code:
if(sig[11] <= 0.0044) {
                if(sig[10]sig[11] <= 25.2686) { return -1; }
                else {


Code:
else {
          if(sig[10]sig[11] <= 16.8569) {
            if(sig[7] <= 0.0008) {


et cetera.

The same program has a similar problem with another instrument selected, USD/CHF. I assume it is not instrument related.

Re: adviseLong produces .c file with syntax error. [Re: GPEngine] #428966
09/06/13 09:51
09/06/13 09:51
Joined: Jul 2000
Posts: 28,075
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 28,075
Frankfurt
Thanks for the example! Yes, this looks like a bug of the decision tree generator. It will be fixed in the next update.

Re: adviseLong produces .c file with syntax error. [Re: jcl] #428992
09/06/13 14:09
09/06/13 14:09
Joined: Sep 2013
Posts: 504
California
G
GPEngine Offline OP
User
GPEngine  Offline OP
User
G

Joined: Sep 2013
Posts: 504
California
You are welcome laugh

How does the bug manifest? Is it simply due to the presence of 12th Series argument?

Re: adviseLong produces .c file with syntax error. [Re: GPEngine] #428993
09/06/13 14:16
09/06/13 14:16
Joined: Jul 2000
Posts: 28,075
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 28,075
Frankfurt
It happens when you use more than 10 signals. Apparently, the decision tree has been tested with 10 or less signals only.


Moderated by  Petra 

Gamestudio download | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1