Integrate an indicator against Brownian motion

The correct treatment of $\int_0^T1_{(K,\infty)}(W(t))\,dW(t)$ is achieved by means of the Tanaka formula by which $$\tag{1} |W(T)|=\int_0^T{\rm sign}(W(t))\,dW(t)+L_T(0) $$ and $L_T(0)$ is the Brownian local time that measures how many times $W(t)$ crosses the point at zero. From $$ {\rm sign}(x)=1_{(x,\infty)}-1_{(-\infty,x)} $$ and $$ |x|=\max(x,0)-\min(x,0) $$ it is not that surprising that there is also a one-sided version of (1): $$\tag{2} (W(T)-K)^+=\int_0^T1_{(K,\infty)}(W(t))\,dW(t)+\frac{1}{2}L_T(K) $$ See for example Borodin & Salminen, Handbook of Brownian Motion, p.43.