Ok, I tried to use frameSync() as in the examples but I still get very different results. What else might be wrong:

Code:
#define H24 (1440/BarPeriod)	

function run()
{
	//BarPeriod = 1440;
	//TimeFrame = 1;
	
	BarPeriod = 60;
	TimeFrame = frameSync(H24);
	
	StartDate = 2015;
	EndDate = 2016;
	
	asset("EUR/USD");
	
	Stop = 20 * PIP;
	if (NumOpenTotal == 0)
		enterLong();
}