Always be invested in the market but make sure that when you need the money that you have invested, it is there for you to spend. It doesn't make sense to keep in the money in the market when you know that you will be in loss when you will have to take it out.