Hello again, I´m back!

Script adapted to what I´m trying:

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)
		return  sube1=true;
	
	
	
	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;

	while(algo(loop("TRND","CNTR")))
	{

		if(Algo == "TRND") 
			tradeUNO();
		else if(Algo == "CNTR") 
			tradeDOS();

	}
	
		
	if(sube1 and sube2)  // <<<----- THIS IS LINE 96
		enterLong();
	
	if(baja1 and baja2)
		enterShort();
	
	
	PlotWidth = 600;
	PlotHeight1 = 300;
}


As you may see, I want to enterLong if both conditions "sube1" and "sube2" are true. Same for enterShort with "baja1" and "baja2"

Problems:

1.- I´m not sure how "sube1, sube2, baja1 and baja2" returned values (true/false) can be red inside run() function.

Quote
WDL6 compiling........
Error in 'line 96:
'sube1' undeclared identifier
< if(sube1 and sube2)>.




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