What happens to my open positions when I log out of MetaTrader?

Open positions and open orders for both MetaTrader 4 and MetaTrader 5 reside on the server are not affected in any way whether you are logged into the terminal or not.  When you are logged out, all pending orders, stop losses, take profits, and stop-outs are processed normally.  

Alternatively, Expert Advisors (EAs) as well as trailing stop losses do require that the terminal be open and logged in at all times to function properly.