Arriving ticks does not mean that you can trade. "Can't open" can also happen within market hours and also with the Z systems, but rarely because they trade inside market hours. With BarPeriod 1440, use a bar offset for trading when the market is open.
The Z systems use a function like this for determining market hours:
bool isMarketOpen()
{
int h = hour()+dst(0); // Greenwich local time
if(Asset == "GER30") {
if(h+CET < 9 || h+CET > 16)
return false;
}
else if(Asset == "UK100") {
if(h < 9 || h > 16)
return false;
}
else if...
...
return true;
}