Set an expiry time for opened trades

 

I need help with setting expiry time for trades in MT4. Lets say that I am trading off the 1H chart. Once I open the trade at the beginning of the hour, I need close it when the candle closes. I want to close it automatically as I am not in front of the computer all the time. It doesn't matter whether I am in profit. I just simply want to close the trade at a specific time. Does any one know how to do this in MT4 / MT5? If it is not available, could anyone point me the right way to get this developed please?

Parameters :

Time Frame : !h, 4H, 8H, D...etc.

Condition:

Based on the selected time frame, orders should be closed when the candle is closed at the selected time frame.

 Any help is greatly appreciated.

Reason: