An investor receives utility bursts from realizing gains and losses at the individual-stock level (Barberis and Xiong, 2009, 2012; Ingersoll and Jin, 2013) and dynamically allocates his mental budget between risky and risk-free assets at the trading-account level. Using savings, he reduces his stockholdings and is more willing to realize losses. Using leverage, he increases his stockholdings beyond his mental budget and is more reluctant to realize losses. While leverage strengthens the disposition effect, introducing leverage constraints mitigates it. Our model predicts that investors with stocks in deep losses sell them either immediately or after stocks rebound a little.