U.S. stocks traded in a narrow range Thursday, within striking distance of all-time highs, ahead of major tech company earnings.