I'm going to go a little against the grain here. Yes, if you absolutely 100% need the money inside of 3 years, it shouldn't be in the market.
However, if it would merely be convenient to spend that money within 3 years, but you have alternatives (like getting a mortgage), then you might take the long view, leave the money in the market, and if a correction should come just as you're about to buy the other property for cash, you just get a small mortgage and leave the money invested in the market. (This is effectively "buying low" by virtue of "not selling low".)
It's all a matter of how critical the money is to spend at a specific time, which is somewhat related to why you to pay all cash. (If there's a hard reason, don't be in the market. If it's more a philosophical leaning or principle, maybe leave the money in the market.)