Formula Sheet
1 Binomial model
1.1 Parameters
- Price of underlying security at time \(0\): \(S\)
- Simple interest rate over one period: \(r\)
- Possible stock price multipliers over one period: \(u\), \(d\)
- Possible prices of the stock after one period: \(\left\{S\cdot u, S\cdot d\right\}\).
1.2 Risk-neutral probabilities
\begin{eqnarray*}&& p_*=\frac{1+r-d}{u-d}\quad\quad q_*=\frac{u-1-r}{u-d}. \end{eqnarray*}1.3 Price of derived security over one period
\begin{eqnarray*}\mbox{Price}&=& \frac1{1+r}\mathbb E_*\left[\mbox{Payoff}\right]. \end{eqnarray*}2 Continuous Black-Scholes Model
2.1 Parameters
- Price of underlying security at time \(0\). \(S_0\)
- Rate of continuously compounded interest. \(r\)
- Expiration time. \(t\)
- Volatility of the stock. \(\sigma\)
2.1 Black-Scholes model for the price of underlying security under risk-neutral probability
\begin{eqnarray*} S(t)&=&S_0e^{\left(r-\frac{\sigma^2}2\right)t+\sigma W_t}. \end{eqnarray*}2.2 Price of derived security
\begin{eqnarray*}\mbox{Price}&=& e^{-rt}\mathbb E_*\left[\mbox{Payoff}\right]. \end{eqnarray*}2.3 Prices of European call and European put
\begin{eqnarray*}C&=&S_0\Phi\left(d_+\right)-Ke^{-rt}\Phi\left(d_-\right)\\ P&=&Ke^{-rt}\Phi\left(-d_-\right)-S_0\Phi\left(-d_+\right)\\ d_{\pm}&=&\frac{\ln\frac{S_0}K+\left(r\pm\frac{\sigma^2}2\right)t}{\sigma \sqrt t}. \end{eqnarray*}3 CPP Tables
3.1 Types of variables
In C++ real numbers are of type double, integers are of type long. If you have to declare a variable whose name is pStar and is supposed to be a real number, then you need to write
double pStar;
3.2 Conversion
Assume that the variable x is of type double and contains a real number and that y is of type long. If you want to convert the real value from x to integer and store the result in y, then you need to write
y=static_cast<long>(x);
3.3 Math and probability functions
- If
xandyare two variables of typedoubleand you want to assign the value \(e^x\) into the variabley, then you need to write this instructionsy=std::exp(x); - If
xandyare two variables of typedoubleand you want to assign the value \(\ln(x)\) into the variabley, then you need to writey=std::log(x); - If
x,y, andzare three variables of typedoubleand you want to assign the value \(x^y\) into the variablez, then you need to writez=std::pow(x,y);orz=std::exp(y*std::log(x)); - To make assignment \(y=\sqrt{x}\), write
y=std::sqrt(x); - To make assignment \(y=\pi\), write
y=MATH::PI; - To make assignment \(y=\frac1{\sqrt{2\pi}}\int_{-\infty}^{x}e^{-\frac{u^2}2}\,du\), write
y=MATH::standardNormalCDF(x);