Gamestudio Links
Zorro Links
Newest Posts
Data from CSV not parsed correctly
by jcl. 04/26/24 11:18
M1 Oversampling
by jcl. 04/26/24 11:12
Why Zorro supports up to 72 cores?
by jcl. 04/26/24 11:09
Eigenwerbung
by jcl. 04/26/24 11:08
MT5 bridge not working on MT5 v. 5 build 4160
by EternallyCurious. 04/25/24 20:49
Trading Journey
by howardR. 04/24/24 20:04
Zorro FIX plugin - Experimental
by flink. 04/21/24 07:12
Scripts not found
by juergen_wue. 04/20/24 18:51
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
3 registered members (AndrewAMD, howardR, 1 invisible), 777 guests, and 6 spiders.
Key: Admin, Global Mod, Mod
Newest Members
Mega_Rod, EternallyCurious, howardR, 11honza11, ccorrea
19048 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
ZORRO bug in adviseLong #480252
05/28/20 06:20
05/28/20 06:20
Joined: May 2015
Posts: 390
Czech Republic
G
Grat Offline OP
Senior Member
Grat  Offline OP
Senior Member
G

Joined: May 2015
Posts: 390
Czech Republic
Hi,

I have trying script from wokshop.

after try train, I get this error:

Quote


Test1 compiling................
Rules: Test1 2010..2018
Assets Assets
Train EURUSD_L 37 patterns
Train EURUSD_S 59 patterns
Rules stored in Test1.c

Error in 'line 19:
Syntax error: Wrong type ANDAND:DOUBLE:DOUBLE:LONG
< if(sig[4]<sig[5] && sig[5]<sig[1] && sig[1]<sig[2] && eq0(sig[2]-sig[3]) && sig[3]<sig[0] && sig[10]<sig[11] && sig[11]<sig[7] && sig[7]<sig[8] && sig[8]<sig[9] && sig[9]<sig[6]) >
Can't compile rules



with change on this:

if(adviseLong(PATTERN+2+FAST+RETURNS,0,
priceHigh(2),priceLow(2),priceClose(2),
priceHigh(1),priceLow(1),priceClose(1),
priceHigh(1),priceLow(1),priceClose(1),
priceHigh(0),priceLow(0),priceClose(0)) > nTr)
enterLong();

Train work OK, but don't work test:
Quote

EUR/USD: 90.3=> 3.798

Parameters stored in Test1.par



Test1 compiling...............
Read Test1.par
Test: Test1 EUR/USD 2010..2018
Assets Assets
Error 062: Can't open Test1.fac (rt:2)
Error 044: Data\Test1.fac not trained



sorry, version:
Z Client S 2.25.7
(c) oP group Germany 2020
Registered: XXX
Zorro Test1 -stay

WIN7 64bit

Milan

Attached Files
test1.c (72 downloads)
Last edited by Grat; 05/28/20 06:30.
Re: ZORRO bug in adviseLong [Re: Grat] #480282
05/29/20 21:42
05/29/20 21:42
Joined: Mar 2019
Posts: 357
D
danatrader Offline
Senior Member
danatrader  Offline
Senior Member
D

Joined: Mar 2019
Posts: 357
This works, no idea why, Zorro 2.25


// Strategy template ///////////////////////

function run()
{
StartDate = 2007;
EndDate = 2018;
BarPeriod = 60; // 1 day
BarZone = WET; // Western European midnight
Weekend = 1; // don't merge Friday and Sunday bars
NumWFOCycles = 5;

assetList("P:\\AssetsCur.csv");
asset("EUR/USD");


NumTrainCycles = 2;
if(TrainCycle == 0) set(RULES|PARAMETERS); // Test or Trade mode
else if(TrainCycle == 2) set(PARAMETERS);
else if(TrainCycle == 1) set(RULES);

if(Train) Hedge = 2; // for training, allow long + short
LifeTime = 3; // one week
MaxLong = MaxShort = -1;

int nTr=optimize(50,10,100);

if(adviseLong(PATTERN+FAST+2+RETURNS,0,
priceHigh(2),priceLow(2),priceClose(2),
priceHigh(1),priceLow(1),priceClose(1),
priceHigh(1),priceLow(1),priceClose(1),
priceHigh(0),priceLow(0),priceClose(0)) > nTr)
enterLong();

if(adviseShort() > nTr)
enterShort();

PlotWidth = 600;
PlotHeight1 = 300;
//plotTradeProfile(40);
//plotWFOCycle(Equity,0);
//plotWFOProfit();
}

Last edited by danatrader; 05/29/20 21:52.
Re: ZORRO bug in adviseLong [Re: Grat] #480287
05/30/20 06:43
05/30/20 06:43
Joined: May 2015
Posts: 390
Czech Republic
G
Grat Offline OP
Senior Member
Grat  Offline OP
Senior Member
G

Joined: May 2015
Posts: 390
Czech Republic
I know where is problem:

if change script:

<b>if(TrainCycle == 0) set(RULES|PARAMETERS|FACTORS); // Test or Trade mode
</b>

no work frown

Last edited by Grat; 05/30/20 06:54.
Re: ZORRO bug in adviseLong [Re: Grat] #480311
05/31/20 09:51
05/31/20 09:51
Joined: Apr 2008
Posts: 586
Austria
Petra Offline
Support
Petra  Offline
Support

Joined: Apr 2008
Posts: 586
Austria
You need FAST for large patterns because otherwise the expression gets too long. This is mentioned in the manual.

If you use factors, you must train them before. I think this is not a bug, set FACTORS in training.

https://manual.zorro-project.com/training.htm

Re: ZORRO bug in adviseLong [Re: Grat] #480325
06/01/20 08:10
06/01/20 08:10
Joined: Jul 2000
Posts: 27,986
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,986
Frankfurt
That's not a bug, but the intial report was in fact a wrong error message. It should either accept the pattern or print a message "pattern too complex", indicating to use the FAST flag. This will be fixed in the next update.

Re: ZORRO bug in adviseLong [Re: Grat] #480326
06/01/20 08:39
06/01/20 08:39
Joined: May 2015
Posts: 390
Czech Republic
G
Grat Offline OP
Senior Member
Grat  Offline OP
Senior Member
G

Joined: May 2015
Posts: 390
Czech Republic
Yes,

I read manual, but question is, how train with set(FACTORS)? In the older version this construction is a without problems.

Code
			NumTrainCycles = 2;
			if(TrainCycle == 1) set(RULES);
			else if(TrainCycle == 2) set(PARAMETERS);			
                        else if(TrainCycle == 0) set(RULES|PARAMETERS|FACTORS); 



for new version need this:
Code
			NumTrainCycles = 3;
			if(TrainCycle == 1) set(RULES);
			else if(TrainCycle == 2) set(PARAMETERS);
			else if(TrainCycle == 3) set(FACTORS);
			else if(TrainCycle == 0) set(RULES|PARAMETERS|FACTORS); 

Re: ZORRO bug in adviseLong [Re: Grat] #480333
06/01/20 12:31
06/01/20 12:31
Joined: Jul 2000
Posts: 27,986
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,986
Frankfurt
You must set the FACTORS flag in a training cycle for training factors.


Moderated by  jcl, Nems, Spirit, Tobias 

Gamestudio download | chip programmers | 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