Dear JCL,

comsider the following two distinct strategies which has the objective to export prices to one CSV file:

Code:
function run() {
	
	BarPeriod = 1440;
	LookBack = 0;
	StartDate = 2008;
	EndDate = 2014;	
		
	vars Open = series(priceOpen());
	vars High = series(priceHigh());
	vars Low = series(priceLow());
	vars Close = series(priceClose());
			
				
	char line[200];
	sprintf(line,
		"%1.5f, %1.5f, %1.5f, %1.5f\n",   
		Open[0], High[0], Low[0], Close[0]);		
		
	if(is(INITRUN))
		file_delete("Data\\export_price2.csv");
	else
		file_append("Data\\export_price2.csv",line);
		
}



and

Code:
function run()
{

        BarPeriod = 1440;
	LookBack = 0;
	StartDate = 2008;
	EndDate = 2014;	

	set(RULES);   
	LifeTime = 1;
	Spread = RollLong = RollShort = Commission = Slippage = 0;
	
        vars Open = series(priceOpen());
	vars High = series(priceHigh());
	vars Low = series(priceLow());
	vars Close = series(priceClose());
	
        adviseLong(SIGNALS+BALANCED, Open[0], High[0], Low[0], Close[0]); 
}



apparently the second strategy produces one CSV where the Close prise is ALWAYS lower then the Open price. Which of course does not make sense.
The first startegy looks ok.
Do you see any error in the code above?
Thanks.
Cheers.