We investigate the valuation of exchange options when the market is affected by changing economic conditions as well as liquidity risks. The volatility and expected returns of both stocks are assumed to be controlled by a continuous‐time Markov chain to reflect the effects of varying economic conditions, and a liquidity discounting factor is employed to capture the impact of market liquidity on stock prices. Once the model has been established, we construct a risk‐neutral measure with the use of regime‐switching Esscher transform, and the characteristic function is then derived in an analytical form, so that a closed‐form formula for exchange options can be presented. We further analyze the effects of the two considered factors on exchange option prices numerically.