I have some M1 data for an asset that is open 0800 to 1645.
(some days actually only have data from 0802 or so, as we can see below)

Given that the M1 data ends at 1645 (market close), I was a bit surprised to see bars generated for the 2000 hour, since the market is not open by then.
A simple script like this

Code:
function run()
{
	set(LOGFILE+PARAMETERS);
	StartDate = 20170801;
	EndDate = 2017;
	LookBack = 600;
	BarPeriod = 240;
	StartWeek = 10800;
	EndWeek = 51645;

	vars prices = series(priceClose());
	LifeTime = 10;

	if (prices[0] > ATR(200))
		enterLong();

}



This generates a testlog that looks something like this:
Code:
[664: Mon 16-10-24 08:00] (10698.20)
[665: Mon 16-10-24 12:00] (10743.87)
[666: Mon 16-10-24 16:00] (10793.82)
[667: Mon 16-10-24 20:00] (10778.14)
[668: Tue 16-10-25 12:00] (10786.25)
[669: Tue 16-10-25 16:00] (10791.68)
[670: Tue 16-10-25 20:00] (10762.88)
[671: Wed 16-10-26 12:00] (10726.22)
[672: Wed 16-10-26 16:00] (10647.86)
[673: Wed 16-10-26 20:00] (10701.58)
[674: Thu 16-10-27 12:00] (10691.86)
[675: Thu 16-10-27 16:00] (10699.20)
[676: Thu 16-10-27 20:00] (10677.64)
[677: Fri 16-10-28 12:00] (10634.99)
[678: Fri 16-10-28 16:00] (10687.86)



Every day ends with a bar at 20:00, except Friday (since I set EndWeek to 51746).

I also get entries like this
Code:
[1421: Tue 11-03-15 16:00] -14053 +313 19/22  (6561.38)
[1422: Tue 11-03-15 20:00] -14053 +799 19/22  (6597.55)
[TEST:9:L2201] Long 1@6643.94 Risk 3103$ p at 20:00:00



Here a position is entered at 20:00. But like I said, the marked closed at 16:45, so in live trading this trade couldn't possibly happen. This is just one example, I get positions both opened and closed at 20:00.

Is this a bug, or am I missing something here? It just seems strange to me that a backtest can open/close trades when there is no historic data for the underlying asset.