How to plot day separator based on Trading session break

I am trying to plot the day separator based on Trading session break. I am using the Dow e-mini future(symbol YM) chart which is traded on exchange for 22 hours and 45 minutes, there are 2 trading breaks, one for 15 minutes(exchange time 16:15 to 16:30) and other for 60 minutes(exchange time 17:00 to 18:00).

For Amibroker chart, i want to consider 60minute break as day separator which means the chart day should start at 18:00 to 17:00(next calendar day). I am using below code to plot this. I am finding the time difference of 2 adjacent bars and comparing it with the timeframe to know if there is any break. However, this logic is not working if i use it on hourly or higher timeframe chart.

	newday= (DateTimeDiff(DateTime(),Ref(DateTime(),-1)-Interval(1)))>3600;
	Plot( newday, "", colorGrey40, styleHistogram|styleDashed|styleOwnScale|styleNoRescale,0,1);

Capture

Request you to please guide me on how to plot day separator at all intraday timeframe.

@beppe Could you please help me in resolving above problem?

This topic was automatically closed 100 days after the last reply. New replies are no longer allowed.