US stocks close higher for third consecutive day