= Solution
For a discrete-time <martingale> $(M_n)$ and real $a<b$, let $U_N[a,b]$ be the <upcrossing count>: buy on the first observation at or below $a$, sell on the next observation at or above $b$, and repeat up to time $N$, counting only completed pairs. Writing $z^-=max(-z,0)$, the <Doob upcrossing inequality> is
$$
\boxed{(b-a)\mathbb E U_N[a,b]\leq\mathbb E(M_N-a)^-.}
$$
This convention permits the first purchase at time zero. Equivalently, the right side is $\mathbb E(M_N-a)^+-\mathbb E(M_0-a)$, because the <martingale> has constant <expected value>.
For completeness, let $H_k\in\{0,1\}$ indicate whether the trading rule holds one unit during $(k-1,k]$. This is a <predictable process>, so the <martingale transform> $G_N=\sum_{k=1}^NH_k(M_k-M_{k-1})$ has zero <expected value>. Every completed trade gains at least $b-a$, and an unfinished trade loses at most $(M_N-a)^-$. Thus $G_N\geq(b-a)U_N[a,b]-(M_N-a)^-$, giving the inequality.
Back to article page