A homotopy algorithm and an index theorem for the general equilibrium model with incomplete asset markets