create solution for best time to buy stock