Let $X$ be a Banach function space over a nonatomic probability space. For a uniformly integrable martingale $f=(f_n)$ with respect to a filtration ${\mathcal F}=({\mathcal F}_n)$, let $Mf =\sup_n |f_n|$ and $\theta_{\mathcal F}f=\sup_n E[|f_{\infty}- f_{n-1}| \mid{\mathcal F}_n]$. We give a necessary and sufficient condition on $X$ for the inequality $\parallel \theta_{\mathcal F}f \parallel_X \leq C\parallel Mf\parallel_X$ to hold.