If you set them to close at the last hour then all your trades will close.
For example, if you set it until 23:00 this means that all opened trades will close at 22:45 for M15, 22:55 for M5, and 22:59 for M1.
I am not sure if this is what you need?
The Academy’s free courses take you from a demo account to your first Expert Advisor, taught by the traders who answer here.