Before even starting to calculate a fair option price, we need to set up the needed variables.
Our variables are held in an instance of BSHolder:
stock: underlying's asset pricestrike: strike priceinterest: the annualized risk-free interest rate (e.g. 0.05 corresponds 5%)vola: volatility (e.g. 0.3 corresponds 30%)term: a time in years (e.g. 0.5 corresponds half-year)All functions regarding calculations are members in BS.
Pass an instance of BSHolder to a function from BS.
E.g.: calculating put price: