Probability Function [racer8]

It's my birthday today! Just turned 20, so I decided to make another indicator. There's not very many indicators on TV that calculate pure probability. Many indicators on TV have the word "Probability" in their titles but they don't actually calculate probability...I call them "false titles". This indicator aims to change that. This is the indicator that every option trader dreams of having. Even if you're not an options trader, it's still very interesting to know the probability of a price movement.

Probability Function calculates the probability of a data point (price) falling within a certain number of standard deviations away from the mean.
So for example, setting the parameter to 2 standard deviations will calculate the probability of price staying within a 2-standard-deviations-channel away from the mean (or moving average). This description is exactly what Bollinger Bands are...which makes it a direct application of this indicator, and Bollinger Bands are used by many traders.

The indicator's formula is an approximation of the integral of the standard normal distribution function. It uses one parameter called "Standard deviation multiple" (SDM). An input of 1 stdev yields 68%, 2 stdevs yields 95%, 3 stdevs yields approx 99.7%, and so on eventually converging to 100%...and it makes sense the bigger the stdev channel, the more likely price will stay within it.
Enjoy and hit the like button!

Open-source script

In true TradingView spirit, the author of this script has published it open-source, so traders can understand and verify it. Cheers to the author! You may use it for free, but reuse of this code in a publication is governed by House Rules. You can favorite it to use it on a chart.

Want to use this script on a chart?