Probability of Stop-Limit Order Execution

Ziyi Zhu

Ziyi Zhu / March 14, 2024

3 min read––– views

This article explores the dynamics underlying a stop-limit order and attempts to calculate its probablity of execution under a geometric Brownian motion.

Stops vs limits

A stop order is an instruction to trade when the price of a market hits a specific level that is less favourable than the current price. On the other hand, a limit order is an instruction to trade if the market price reaches a specified level more favourable than the current price.

There is no reason to only use one or the other type of order – both are extremely useful tools for a trader. In fact, some platforms go so far as to combine both orders into a single ‘stop-limit order’. This would enable traders to predefine their conditions for trading, entering a trend at a certain price level and exiting the trade once they’ve taken a certain amount of profit. Therefore, if we can understand the probability of a stop order getting triggered as opposed to a limit order, we can then estimate the expected return of a single stop-limit order.

Brownian motion with two absorbing boundaries

A geometric Brownian motion (GBM) is a continuous-time stochastic process in which the logarithm of the randomly varying quantity follows a Brownian motion (also called a Wiener process) with drift. The stock price StS_t is said to follow a GBM if it satisfies the following stochastic differential equation (SDE):

dSt=μStdt+σStdWtdS_t = \mu S_t dt + \sigma S_t dW_t

WtW_t is a Wiener process or Brownian motion, and the expected return μ\mu and the standard deviation of returns (volatility) σ\sigma are constants. For an arbitrary initial value S0S_0 the above SDE has the analytic solution:

St=S0exp[(μσ22)t+σWt]S_t = S_0 \exp \left[ \left( \mu - \frac{\sigma^2}{2} \right) t + \sigma W_t \right]

Suppose that α\alpha and β\beta are absorbing boundaries and α>S0>β\alpha > S_0 > \beta, we would like to know the probability that StS_t will be absorbed at the t=ταt=\tau_\alpha boundary, i.e. the probability that StS_t hits α\alpha without ever hitting β\beta.

Optional stopping theorem

In probability theory, the optional stopping theorem says that a martingale stopped at a stopping time is a martingale, i.e. the expected value of a martingale at a stopping time is equal to its initial expected value. Therefore, we can take advantage of the exponential martingale:

Zt=exp[λWt12λ2t]Z_t = \exp \left[ \lambda W_t - \frac{1}{2} \lambda^2 t \right]

Applying a change of variables to the analytical solution for StS_t:

Yt=log(St)log(S0)σ=(μσσ2)t+Wt=μ~t+Wt\begin{aligned} Y_t &= \frac{\log (S_t) - \log (S_0)}{\sigma}\\ &= \left( \frac{\mu}{\sigma} - \frac{\sigma}{2} \right) t + W_t\\ &= \tilde{\mu} t + W_t \end{aligned}

where μ~=μσσ2\tilde{\mu} = \frac{\mu}{\sigma} - \frac{\sigma}{2}. Substituting WtW_t with Ytμ~tY_t - \tilde{\mu} t into the exponential martingale:

Zt=exp[λ(Ytμ~t)12λ2t]Z_t = \exp \left[ \lambda (Y_t - \tilde{\mu} t) - \frac{1}{2} \lambda^2 t \right]

To remove the terms including time tt, we can set λ=2μ~\lambda = -2 \tilde{\mu}:

Zt=exp(2μ~Yt)Z_t = \exp \left( -2 \tilde{\mu} Y_t \right)

Let pαp_\alpha be the probability that the Brownian motion hits α\alpha before β\beta. Since E[Zt]=1\mathbb{E}\left[ Z_t \right] = 1 by optional stopping theorem, we have

E[Zτ]=exp(2μ~Yτα)pα+exp(2μ~Yτβ)(1pα)=1\mathbb{E}\left[ Z_\tau \right] = \exp \left( -2 \tilde{\mu} Y_{\tau_\alpha} \right) p_\alpha + \exp \left( -2 \tilde{\mu} Y_{\tau_\beta} \right) (1 - p_\alpha) = 1

where τ=min(τα,τβ)\tau = \min(\tau_\alpha, \tau_\beta), Yτα=logαlogS0σY_{\tau_\alpha} = \frac{\log \alpha - \log S_0}{\sigma} and Yτβ=logβlogS0σY_{\tau_\beta} = \frac{\log \beta - \log S_0}{\sigma}. Hence, we can simply the equation to get

pα=1exp(2μ~Yτβ)exp(2μ~Yτα)exp(2μ~Yτβ)p_\alpha = \frac{1 - \exp \left( -2 \tilde{\mu} Y_{\tau_\beta} \right)}{\exp \left( -2 \tilde{\mu} Y_{\tau_\alpha} \right) - \exp \left( -2 \tilde{\mu} Y_{\tau_\beta} \right)}