Its interesting that you now also get the wrong results. I posted that same script earlier and then you said you got the right results! So it seems you are not getting the same results every time?

And Spread and Commission does NOT MAKE ANY difference for me. I have trained and tested with both!!! Like so:

Code:
var objective()
{
	return ((var)(NumWinLong+NumWinShort))/(NumLossLong+NumLossShort);
}


function run()
{
	set(LOGFILE);
	
	BarPeriod = 5;
	LookBack = 100;
	NumWFOCycles = 20;
	NumCores = -1;
	
	set(BINARY);
	set(PARAMETERS);
	int TimePeriod = optimize(20,10,100);
	var Threshold = 0.01*(HH(TimePeriod)-LL(TimePeriod));

	while (asset(loop("EUR/USD")))
	{
		WinPayout = 75;
		LossPayout = 0;
		Spread = Commission = 0;
		
		if(NumOpenLong+NumOpenShort == 0) 
		{
			LifeTime = 1;
			if(HH(TimePeriod) - priceClose() < Threshold)
				enterShort();
			else if(priceClose() - LL(TimePeriod) < Threshold)
				enterLong();
		}
	}
}



I get the wrong results as I already posted!

Could you post the full script with a working asset loop that produces the correct results for you?

Last edited by trenki2; 11/08/16 15:16.