This project demonstrates a pricing engine for European call/put options using an application of the Black-Scholes (or Black-Scholes-Merton) equation.
The Black-Scholes model is derived from an equation that was meant to model Brownian motion. This is a fundamentally flawed approach to work with stocks; it simply approximates the market well in many cases.
It is a gross simplification that just works well long-term if you're lucky and invest smartly. This repository must not be used to generate actual investment advice. It's more of an educational tool.
Wikipedia might be better at explaining this than me.
But in short, the Black-Scholes model is a solution that can be applied to options trading (specifically, options that have to be held for a certain amount of time — basically, European options trading).
Where:
-
$C$ → price of the call option -
$S_t$ → current (spot) price of the asset -
$K$ → strike price of the option -
$r$ → risk-free interest rate -
$t$ → time to maturity (in years) -
$\sigma$ → standard deviation (i.e. volatility) of the asset’s returns -
$\Phi(x)$ → standard normal cumulative distribution function
The terms
The underlying asset is modeled as:
Basically, imagine that you expect a share will skyrocket in price soon. So you buy the right to buy it later at the current price.
Yes, there are other options. A European option can only be sold at the time you've specified to hold it for. American options can be sold any time before that too.
The Black-Scholes model makes some assumptions that require a person to be very prudent while using it. It's not a money-printing machine but rather a fair approximation of a stable (non-volatile) market.
Here are some assumptions made by the model:
- Stocks can move randomly but can't jump — they follow a log-normal path.
- It assumes that the market performs Brownian motion: random movement.
- You can't just make a profit by holding money.
It employs a formula that calculates the expected value of the option, telling how much it's likely worth based on:
- How far the current price is from the strike price.
- How long you’re holding it.
- How volatile (uncertain) the asset is.
- How much interest money earns in a safe place.