Quantitative Finance Stack Exchange is a question and answer site for finance professionals and academics. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

When placing a trade with Stop Loss and Take Profit orders in a hypothetical random market (i.e. 0.5 probability of up tick and 0.5 probability of down tick), assuming:

x is the distance in ticks of the SL order from the entry price. y is the distance in ticks of the TP order from the entry price.

How do we calculate the probability of x being triggered first?

share|improve this question
up vote 2 down vote accepted

The answer can be found here under 1.3) Random Walk Hitting Probabilities (when events have equal probability of $\frac{1}{2}$ each).

\begin{equation} p(a) = \frac{b}{a+b} \end{equation}

$p(a)$ would be the probability of take-profit hit first. To look at probability of stop-loss being hit first, just take 1 minus the above, resulting with $a$ on the top (where $a$ is take profit and $b$ is hit stop loss level, respectively).

You can run this script I wrote in R, to verify:

tw<-0; d<-function() sample(c(-1,1),size=1)

#x=sl; y=tp
for(i in 1:1000){
tw<- sum(tw+d())
if(tw== x || tw==y) break()}

sl<- -10; tp<- 20

Result for hitting x (stop loss first, where x= -10) is

resx/(resx+resy) = 0.673716

while, tp/(tp+stop) = 20/(20+10) gives 0.6666667, in agreement.

share|improve this answer
That's the one indeed. Thanks for the confirmation (and for the script). – Marven Dec 16 '12 at 17:02

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.