The Charles Schwab Corp., based in San Francisco, agreed to acquire TD Ameritrade Holding Corp. of Omaha, Nebraska, for about $26 billion, creating a combined discount brokerage with both retail and office space across the country as well as plans for a headquarters in the greater Dallas area.