Title: How and When to Invest in the Stock Market