# How to calculate probability of touching a take-profit without touching a stop-loss?

How to calculate probability of touching a take-profit without touching a stop-loss (no-dividend stock, infinite time)?

• Um, simple stock price movements are totally random, at least for the question here. Also, please take a look at some of the other posts on this site for how questions are worded and formatted. – chrisaycock Oct 5 '12 at 21:08
• There is an article on forexop where maximal curves and a random walk are used to calculate the different probabilities hitting the stop loss, the take profit or being still open. There is also an excel file to download, where the formulas can be found. – Martin Seeler Jun 25 '16 at 18:07

a) you can run a Monte Carlo simulation in which you model stock price movements and then you can look at the future pay off as a function of path dependency into which you incorporate your stop losses and take profits. Done this over many iterations you will be able to derive your probabilities. Caveat here is your result will be strongly dependent on your model assumption of how you derive stock price movements.

b) you could run back tests over actual pricing data. You generate trading signals, associated stops and take-profit targets and you derive your probabilities through simple counting processes of how often your stop loss was hit vs take profit targets.

I would strongly prefer the latter approach, this is by the way a very common way to also calculate the quality of entry and exit signals (not using stop loss and target levels but by keeping track of how prices performed after the entry/after the exit).

P.S. I find the question correctly worded and I think it actually makes sense.

First, let us formulate the problem mathematically:

A symmetric random walk starts at 0 and moves up or down one unit (with equal probability) every 1 second. The are two absorbing barriers located at H and -L, with $$H,L>0$$. Given infinite time, what is the probability $$p_H$$ that H will be hit before -L is hit and what is the probability $$p_L$$ that -L will be hit before H?

Since we have infinite time, one or the other barrier will be hit eventually. In the special case where $$H=L$$ it is clear from symmetry that $$p_H=p_L=\frac{1}{2}$$. In the general case, the probabilities are $$p_H=\frac{L}{H+L}$$ and $$p_L=\frac{H}{H+L}$$. [Source: S. E. Alm: Simple Random Walk, 2002].

For a stock it is not the price of the stock which follows a random walk, but its logarithm, which starts at initial value $$\ln S_0$$ So in the above formulas we would replace H and L with the logs of the position of the barriers compared to the starting point. The final result is:

$$p_H = \frac{\ln (L/S_0)}{\ln (H/S_0)+\ln (L/S_0)}$$ and similarly $$p_L= \frac{\ln (H/S_0)}{\ln (H/S_0)+\ln (L/S_0)}$$

Edit: on 2019/11/11 I corrected a typo pointed out by @ANdrea

If $$H > L$$, I can't believe $$p_H$$ is greater than $$p_L$$. If we put it in terms of TakeProfit (TP) and StopLoss (SL) concerning the FOREX market, if TP is 20 pips and SL is 10 pips, it will be more likely to hit the ST first than the TP. This is why I suspect the correct equations are $$p_H = L/(L+H)$$ and $$p_L = H/(L+H)$$. And now it's time to dive into "S. E. Alm: Simple Random Walk, 2002". Br

• You are right! Thank you. – Alex C Nov 12 '19 at 2:19
• By the way, if we also decide to consider the broker's spread (which is always different from zero!) in our discussion, and since such a spread always places our trader into an initial disadvantageous position, we can eventually rewrite our equations as: pH = (L - spread)/(L + H) , and pL = (H + spread)/(L + H) Br – ANdrea Nov 26 '19 at 21:14

Google "MIT a bug's life gambler's ruin" for an exact model for this, albeit in a binomial world. The bug flips a coin every iteration to move left or right; and it might then end up falling off the left cliff or the right one. Which is a perfect metaphor for this challenge.