We show that including a term which accounts for finite liquidity in portfolio optimization naturally mitigates the instabilities that arise in the estimation of coherent risk measures on finite samples. This is because taking into account the impact of trading in the market is mathematically equivalent to introducing a regularization on the risk measure. We show here that the impact function determines which regularizer is to be used. We also show that any regularizer based on the norm [Formula: see text] with [Formula: see text] makes the sensitivity of coherent risk measures to estimation error disappear, while regularizers with [Formula: see text] do not. The [Formula: see text] norm represents a border case: its “soft” implementation does not remove the instability, but rather shifts its locus, whereas its “hard” implementation (including hard limits or a ban on short selling) eliminates it. We demonstrate these effects on the important special case of expected shortfall (ES) which has recently become the global regulatory market risk measure.