We study how aggregate market liquidity influences optimal portfolio allocation.
Its effect decreases with the investment horizon and the asset's liquidity.
Optimal weights exhibit a shift toward larger stocks as market liquidity dries up.
Optimal weights in the risky assets decrease as market liquidity dries up.
Our liquidity-based strategy enhances performance and reduces potential losses.