When is the best time to invest – or not?