Amazon's strong earnings countered Apple's weaker China sales as Wall Street's main indexes opened higher.