ZORRO bug in adviseLong

Posted By: Grat

ZORRO bug in adviseLong - 05/28/20 06:20

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 File
test1.c  (73 downloads)
Posted By: danatrader

Re: ZORRO bug in adviseLong - 05/29/20 21:42

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();
}
Posted By: Grat

Re: ZORRO bug in adviseLong - 05/30/20 06:43

I know where is problem:

if change script:

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

no work frown
Posted By: Petra

Re: ZORRO bug in adviseLong - 05/31/20 09:51

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
Posted By: jcl

Re: ZORRO bug in adviseLong - 06/01/20 08:10

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.
Posted By: Grat

Re: ZORRO bug in adviseLong - 06/01/20 08:39

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); 
Posted By: jcl

Re: ZORRO bug in adviseLong - 06/01/20 12:31

You must set the FACTORS flag in a training cycle for training factors.
© 2024 lite-C Forums