Using this code:
Code
function run()
{
	StartDate = 20191101;
	EndDate = 20191227;
	BarPeriod = 60;
	TimeFrame = 4;
	assetList("AssetsFix");
	asset("EUR/USD");
	
	var p = price(0);
	var o = priceOpen(0);
	var h = priceHigh(0);
	var l = priceLow(0);
	var c = priceClose(0);
	
	vars P = series(p);
	vars O = series(o);
	vars H = series(h);
	vars L = series(l);
	vars C = series(c);
	
	if(Init)
		print(TO_CSV,"yyyy-mm-dd HH:MM,frame(0),p,P[0],o,O[0],h,H[0],l,L[0],c,C[0]\r\n");
	else
		print(TO_CSV,"%04d-%02d-%02d %2d:%2d,%d,%0.5f,%0.5f,%0.5f,%0.5f,%0.5f,%0.5f,%0.5f,%0.5f,%0.5f,%0.5f\r\n",
			year(0),month(0),day(0),hour(0),minute(0),
			frame(0),p,P[0],o,O[0],h,H[0],l,L[0],c,C[0]
			);
	
}
...produces the attached CSV. It appears that priceOpen et. al. ignores frame(0), which is fine so long as you are using a series.

Attached Files
ohlc.csv (70 downloads)