The Dow industrials posted a gain for the 10th straight session despite earnings disappointments, with optimism over inflation supporting the broader market.