If I "declare" bool sube1, sube2, sube3 and sube4 if solves previous issue but then:

Problem 2: Can't go to FALSEGOTO:DOUBLE:: ---> Why is this error? I´m trying to obtain a true statement if a condition is true.

Quote
WDL6 compiling.........
Error in 'line 29:
Syntax error: Can't go to FALSEGOTO:DOUBLE::.
< range(1),range(2),range(3),range(4))>Threshold1) // line 28
>



This is same script with sube1, sube2, baja1 and baja2 declared:


Code
// WDL6 trying to make it work ///////////////////


var change(int n)
{
	return scale((priceClose(0) - priceClose(n))/priceClose(0),100)/100;
}

var range(int n)
{
	return scale((HH(n) - LL(n))/priceClose(0),100)/100;
}
	

function tradeUNO()
{
	if(Init) print(TO_WINDOW,"\nR and Keras required"); 
	Script = "DeepLearnKeras1";
	
	bool sube1=false;
	bool baja1=false;
	var Threshold1 = 0.5;
	var vLong1,vShort1;
	
	
	if (vLong1 = adviseLong(NEURAL+BALANCED,0,
	change(1),change(2),change(3),change(4),
		range(1),range(2),range(3),range(4))>Threshold1)  // line 28
							// line 29
		return sube1=true;		// line 30
	
	if (vShort1 = adviseShort(NEURAL+BALANCED,0,
	change(1),change(2),change(3),change(4),
		range(1),range(2),range(3),range(4))>Threshold1)
		
		return  baja1=true;

}

function tradeDOS()
{
	if(Init) print(TO_WINDOW,"\nR and Keras required"); 
	Script = "DeepLearnKeras2";

	bool sube2=false;
	bool baja2=false;
	var Threshold2 = 0.5;
	var vLong2,vShort2;
	
	
	if (vLong2 = adviseLong(NEURAL+BALANCED,0,
	change(1),change(2),change(3),change(4),
		range(1),range(2),range(3),range(4))>Threshold2)

		return sube2=true;
	
	if (vShort2 = adviseShort(NEURAL+BALANCED,0,
	change(1),change(2),change(3),change(4),
		range(1),range(2),range(3),range(4))>Threshold2)

		return baja2=true;
}

function run()
{
	NumCores = -2;		// use multiple cores (Zorro S only)
	StartDate = 20170101;
	EndDate= 20190101;
	BarPeriod = 1440;	// 1 hour
	LookBack = 100;

	assetList("AssetsDarwinexFMB");
	asset("EUR/USD");
	set(RULES);
	LifeTime=3;
	
	bool sube1=false;  [color:#FF0000]//  DECLARED HERE TOO SO THERE´S NO ERROR MESSAGE[/color]
	bool baja1=false;
	bool sube2=false;
	bool baja2=false;
	
	while(algo(loop("TRND","CNTR")))
	{
		if(Algo == "TRND") 
			tradeUNO();
		else if(Algo == "CNTR") 
			tradeDOS();
	}
	
	if(sube1 and sube2)
		enterLong();
	
	if(baja1 and baja2)
		enterShort();
	

	PlotWidth = 600;
	PlotHeight1 = 300;
}



Thank you

Last edited by tomaslolo; 03/25/22 11:23.