Hi guys,

I use the code below for the Close and Open of the previous day.
Monday I have a problem to identify correctly the close on friday.
The code below consider the close on sunday. Why?
How Can I make intercept the right close on friday without consider sunday?

Code:
function run()
{
	
	var open; var close; 
	StartDate = 20181101;
	EndDate = 20181130;
	#define H24 (1440/BarPeriod)
	#define H4 (240/BarPeriod)
	#define H1 (60/BarPeriod)
	
	StartWeek = 10000;
	EndWeek = 52300;

	BarPeriod = 60; // 1 hour (60 minutes) bars

	// create a 4-hour price series ///////////////////////////////////
	TimeFrame = H4;
	vars PriceH4 = series(priceClose());
	 
	// create a 24-hour price series /////////////////////////////////
	TimeFrame = frameSync(H24);
	vars CloseH24 = series(priceClose());
	vars OpenH24  = series(priceOpen());

	close=CloseH24[0];
	open=OpenH24[0];
}



thanks

Last edited by tradingest; 12/12/18 20:41.