In MQL4 there are holes in the history data, this is not unexpected. But if some EA works on real, at least then ticks should come. So you can just skip this situation. In fact, if the EA does not receive any ticks from the broker, this probably means that something is wrong anyway - markets are closed, network connection is broken or something else - so even if you force the trades to be closed, it will probably not happen. Because you can always put some blocks under "on Timer" and this event does not care if there are ticks or not. Well, "on Timer" don't work very well in the Tester, if it works at all. But anyway, if with "on Timer" you force the EA to close everything at 08:00 and the markets are closed at that time... then what is the point.