Stocks gain as fresh earnings awaited