If the rules are as simple as you state - here's what you are after
https://fxdreema.com/shared/QfzAfqTJb
It uses the Expiration of the order to close itself.
Because some of your periods are consecutive we can set the hour filter to extend for the 2 periods and by using the Once per bar then it will on perform the buy or sell once in the period.
As you can only set 4 period filters in the Hours Filter the Sell one has one more block to handle the extra.
The expirations are "1 hour from the time of the order" which may actually then be a fraction after the candle closes but should be pretty close. You could change it so that it expired 59 mins instead.
I just set the time stuff and conditions to GMT so you may need to vary those according to your requirements.


