US stocks closed higher Wednesday after a dramatic surge in the final minutes of the trading session, extending its winning streak to seven days as traders shrugged off weak economic data and looked ahead to results from technology behemoths Meta Platforms Inc. and Microsoft Corp.