Risk-Based Capital Requirements and Optimal Liquidation in a Stress Scenario