= Solution
Write $z^- =\max(-z,0)$. For $a<b$, let $U_N[a,b]$ be the <upcrossing count> obtained by successively buying at an observation at or below $a$ and selling at an observation at or above $b$, with the first purchase allowed at time zero. The <Doob upcrossings lemma> for an integrable discrete-time <martingale> is
$$
\boxed{(b-a)\mathbb E U_N[a,b]\leq\mathbb E(X_N-a)^--\mathbb E(X_0-a)^-\leq\mathbb E(X_N-a)^-.}
$$
The weaker last bound is also the usual <Doob upcrossing inequality>.
To prove it, hold one unit between each purchase and sale, and zero units otherwise. If $H_k$ records the holding over $(k,k+1]$, the decision is $\mathcal F_k$-<measurable>, with $H_k\in\{0,1\}$. The resulting <martingale transform> has gain
$$
G_N=\sum_{k=0}^{N-1}H_k(X_{k+1}-X_k),\qquad \mathbb E G_N=0.
$$
Each completed <upcrossing> earns at least $b-a$. An unfinished holding loses at most $(X_N-a)^-$. If a purchase occurs at zero, its price is $X_0\leq a$, giving the additional discount $(X_0-a)^-$, whether that holding has been sold or remains open. If no purchase occurs at zero, this extra term is zero. Therefore, path by path,
$$
G_N\geq(b-a)U_N[a,b]-(X_N-a)^-+(X_0-a)^-.
$$
Taking <expectations> proves the bound.
The <martingale convergence theorem>, stated without proof, says that a discrete-time <martingale> satisfying $\sup_n\mathbb E|X_n|<\infty$ converges <almost surely> to a finite <integrable random variable> $X_\infty$. In particular every nonnegative <martingale> converges <almost surely> to a finite limit. Under <uniform integrability>, the <uniformly integrable martingale convergence theorem> additionally gives <convergence in L1> and $X_n=\mathbb E[X_\infty\mid\mathcal F_n]$.
Back to article page