Know when to invest