When building a system for e.g. DAX, I want to limit the strategy to only trade during market hours. Reading about AssetMarket in the manual it says:

"Time zone of the currently selected asset, used for setting AssetFrame to a TimeFrame that skips all bars outside market hours in local time, but follows the BarPeriod inside market hours. The market hours are given by StartMarket and EndMarket."

Great, this looks just like what I want: Skip bars outside market hours.

So I add to the top of my strategy

Code:
set(LOGFILE+PARAMETERS);
	StartDate = 2004;
	EndDate = 2017;
	LookBack = 600;
	BarPeriod = 240;
	AssetMarket = UTC;
	StartMarket = 0800;
	EndMarket = 1645;
	
	vars close = series(priceClose());
	vars open = series(priceOpen());
	vars high = series(priceHigh());
	vars low = series(priceLow());
	vars price = series(price());

        ....



But still, after backtesting and looking at the trade log, I can see entries, stop losses and time stops being executed outside market hours.

So how can I limit the strategy to only execute entries and stops inside market hours?