We study the consumption and investment model under time-varying liquidity constraints (TVLC) that are widely used in reality. We first develop a martingale method to analyze the case in which the borrowing limit is specified by the debt-to-income ratio limit and then extend this framework to deal with the collateral borrowing case in which the borrowing limit is restricted to the loan-to-value ratio limit. Implications of the TVLC for the optimal policies differ considerably from what are shown in the previous literature on the fixed borrowing limit and are consistent with those shown in the empirical literature.